修复数据在-1到1之间坐标轴显示错误问题

This commit is contained in:
zhengzhipeng
2023-08-15 11:45:32 +08:00
parent 3d4360a10a
commit 4fde95eab7
2 changed files with 19 additions and 28 deletions

View File

@@ -353,7 +353,14 @@ namespace XCharts.Runtime
}
else if (string.IsNullOrEmpty(newNumericFormatter) && !isLog)
{
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "f0" : "f" + MathUtil.GetPrecision(maxValue);
if (Math.Abs(maxValue) >= Math.Abs(minValue))
{
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "f0" : "f" + MathUtil.GetPrecision(maxValue);
}
else
{
newNumericFormatter = MathUtil.IsInteger(minValue) ? "f0" : "f" + MathUtil.GetPrecision(minValue);
}
}
if (string.IsNullOrEmpty(m_Formatter))
{