From d4e7fdbb9c1966a4cfe1b5c2ee32577f86386526 Mon Sep 17 00:00:00 2001 From: Jacob Rapoport Date: Sat, 26 Oct 2019 17:19:09 -0700 Subject: [PATCH 1/2] add UpdateThemeInfo API --- Assets/XCharts/Runtime/API/BaseChart_API.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/XCharts/Runtime/API/BaseChart_API.cs b/Assets/XCharts/Runtime/API/BaseChart_API.cs index 6ece0e4f..1f940a15 100644 --- a/Assets/XCharts/Runtime/API/BaseChart_API.cs +++ b/Assets/XCharts/Runtime/API/BaseChart_API.cs @@ -416,6 +416,19 @@ namespace XCharts RefreshChart(); } + + /// + /// Update chart theme info. + /// 切换图表主题。 + /// + /// themeInfo + public void UpdateThemeInfo(ThemeInfo themeInfo) + { + m_ThemeInfo = themeInfo; + UpdateTheme(m_ThemeInfo.theme); + } + + /// /// Whether series animation enabel. /// 启用或关闭起始动画。 From a19a9179413d2b2713288154a2714eec3aa0553b Mon Sep 17 00:00:00 2001 From: Jacob Rapoport Date: Mon, 11 Nov 2019 18:21:30 -0800 Subject: [PATCH 2/2] support standard c# string formatters on axis labels --- Assets/XCharts/Runtime/Component/Sub/AxisLabel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } } }