修复Tooltip在对数轴时指示不准确的问题

This commit is contained in:
monitor1394
2023-11-28 10:04:15 +08:00
parent 7ea260b986
commit 0a19b2a6cc
8 changed files with 81 additions and 22 deletions

View File

@@ -727,6 +727,13 @@ namespace XCharts.Runtime
var each = axisLength / data.Count;
return (float)(each * (value + 0.5f));
}
else if (IsLog())
{
var logValue = GetLogValue(value);
var logMin = GetLogValue(context.minValue);
var logMax = GetLogValue(context.maxValue);
return axisLength * (float)((logValue - logMin) / (logMax - logMin));
}
else
{
return axisLength * (float)((value - context.minValue) / context.minMaxRange);