修复YAxisLabel可能会重复的问题

This commit is contained in:
monitor1394
2023-08-23 22:02:00 +08:00
parent 11eccbc39b
commit 0331804a85

View File

@@ -355,11 +355,11 @@ namespace XCharts.Runtime
{ {
if (Math.Abs(maxValue) >= Math.Abs(minValue)) if (Math.Abs(maxValue) >= Math.Abs(minValue))
{ {
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "f0" : "f" + MathUtil.GetPrecision(maxValue); newNumericFormatter = MathUtil.IsInteger(maxValue) ? "0.#" : "f" + MathUtil.GetPrecision(maxValue);
} }
else else
{ {
newNumericFormatter = MathUtil.IsInteger(minValue) ? "f0" : "f" + MathUtil.GetPrecision(minValue); newNumericFormatter = MathUtil.IsInteger(minValue) ? "0.#" : "f" + MathUtil.GetPrecision(minValue);
} }
} }
if (string.IsNullOrEmpty(m_Formatter)) if (string.IsNullOrEmpty(m_Formatter))