mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 03:58:49 +00:00
优化numericFormatter
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
* (2020.04.28) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
|
* (2020.05.04) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
|
||||||
* (2020.04.28) 增加`自由锚点`支持,任意对齐方式
|
* (2020.04.28) 增加`自由锚点`支持,任意对齐方式
|
||||||
* (2020.04.23) 优化`ScatterChart`的`Tooltip`显示效果
|
* (2020.04.23) 优化`ScatterChart`的`Tooltip`显示效果
|
||||||
* (2020.04.23) 增加`Tooltip`的`formatter`对`{.}`、`{c:0}`、`{c1:1}`的支持
|
* (2020.04.23) 增加`Tooltip`的`formatter`对`{.}`、`{c:0}`、`{c1:1}`的支持
|
||||||
|
|||||||
@@ -264,10 +264,7 @@ namespace XCharts
|
|||||||
content = m_Formatter.Replace("{value:f1}", ChartCached.FloatToStr(value, string.Empty, 1));
|
content = m_Formatter.Replace("{value:f1}", ChartCached.FloatToStr(value, string.Empty, 1));
|
||||||
else if (content.Contains("{value}"))
|
else if (content.Contains("{value}"))
|
||||||
{
|
{
|
||||||
if (value - (int)value == 0)
|
content = m_Formatter.Replace("{value}", ChartCached.NumberToStr((int)value, numericFormatter));
|
||||||
content = m_Formatter.Replace("{value}", ChartCached.IntToStr((int)value));
|
|
||||||
else
|
|
||||||
content = m_Formatter.Replace("{value}", ChartCached.FloatToStr(value, string.Empty, 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
content = content.Replace("\\n", "\n");
|
content = content.Replace("\\n", "\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user