diff --git a/Assets/XCharts/Runtime/API/BaseChart_API.cs b/Assets/XCharts/Runtime/API/BaseChart_API.cs index 4c54f6f8..2c499067 100644 --- a/Assets/XCharts/Runtime/API/BaseChart_API.cs +++ b/Assets/XCharts/Runtime/API/BaseChart_API.cs @@ -420,6 +420,19 @@ namespace XCharts RefreshChart(); } + + /// + /// Update chart theme info. + /// 切换图表主题。 + /// + /// themeInfo + public void UpdateThemeInfo(ThemeInfo themeInfo) + { + m_ThemeInfo = themeInfo; + UpdateTheme(m_ThemeInfo.theme); + } + + /// /// Update chart theme info. /// diff --git a/Assets/XCharts/Runtime/Component/Sub/AxisLabel.cs b/Assets/XCharts/Runtime/Component/Sub/AxisLabel.cs index b575257b..1fbd86a4 100644 --- a/Assets/XCharts/Runtime/Component/Sub/AxisLabel.cs +++ b/Assets/XCharts/Runtime/Component/Sub/AxisLabel.cs @@ -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("
", "\n"); return content; + } else { + return value.ToString(m_Formatter); } } }