优化numericFormatter

This commit is contained in:
monitor1394
2020-05-04 14:25:02 +08:00
parent b333a87f04
commit 41d01f0555
2 changed files with 2 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
# 更新日志
* (2020.04.28) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
* (2020.05.04) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
* (2020.04.28) 增加`自由锚点`支持,任意对齐方式
* (2020.04.23) 优化`ScatterChart``Tooltip`显示效果
* (2020.04.23) 增加`Tooltip``formatter``{.}``{c:0}``{c1:1}`的支持

View File

@@ -264,10 +264,7 @@ namespace XCharts
content = m_Formatter.Replace("{value:f1}", ChartCached.FloatToStr(value, string.Empty, 1));
else if (content.Contains("{value}"))
{
if (value - (int)value == 0)
content = m_Formatter.Replace("{value}", ChartCached.IntToStr((int)value));
else
content = m_Formatter.Replace("{value}", ChartCached.FloatToStr(value, string.Empty, 1));
content = m_Formatter.Replace("{value}", ChartCached.NumberToStr((int)value, numericFormatter));
}
content = content.Replace("\\n", "\n");