mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
Merge pull request #23 from jrapoport/master
support standard c# string formatters in axis labels
This commit is contained in:
@@ -420,6 +420,19 @@ namespace XCharts
|
||||
RefreshChart();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Update chart theme info.
|
||||
/// 切换图表主题。
|
||||
/// </summary>
|
||||
/// <param name="themeInfo">themeInfo</param>
|
||||
public void UpdateThemeInfo(ThemeInfo themeInfo)
|
||||
{
|
||||
m_ThemeInfo = themeInfo;
|
||||
UpdateTheme(m_ThemeInfo.theme);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Update chart theme info.
|
||||
/// </summary>
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace XCharts
|
||||
else
|
||||
return ChartCached.FloatToStr(value, 1);
|
||||
}
|
||||
else
|
||||
else if (m_Formatter.Contains("{value"))
|
||||
{
|
||||
var content = m_Formatter;
|
||||
if (content.Contains("{value:f2}"))
|
||||
@@ -181,6 +181,8 @@ namespace XCharts
|
||||
content = content.Replace("\\n", "\n");
|
||||
content = content.Replace("<br/>", "\n");
|
||||
return content;
|
||||
} else {
|
||||
return value.ToString(m_Formatter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user