增加HeatmapmaxCache参数支持

This commit is contained in:
monitor1394
2023-12-26 23:08:41 +08:00
parent 178215d980
commit f1c504e81a
12 changed files with 60 additions and 27 deletions

View File

@@ -543,11 +543,14 @@ namespace XCharts.Runtime
/// <param name="axis"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int GetAxisValueSplitIndex(Axis axis, double value, int totalSplitNumber = -1)
public static int GetAxisValueSplitIndex(Axis axis, double value, bool checkMaxCache, int totalSplitNumber = -1)
{
if (axis.IsCategory())
{
return (int)value;
if (checkMaxCache)
return axis.maxCache > 0 ? (int)value - (axis.GetAddedDataCount() - axis.data.Count) : (int)value;
else
return (int)value;
}
else
{