Merge pull request #23 from jrapoport/master

support standard c# string formatters in axis labels
This commit is contained in:
monitor1394
2019-11-12 12:39:37 +08:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

View File

@@ -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>

View File

@@ -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);
}
}
}