From 067a70e3850133e8a4a9b79ef2d519fffafa913d Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 11 Dec 2019 02:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Legend`=E9=83=BD=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=97=B6`Value=E8=BD=B4`=E8=BF=98=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/XCharts/Runtime/Component/Main/Axis.cs | 9 ++++++++- Assets/XCharts/Runtime/Internal/CoordinateChart.cs | 2 +- Assets/XCharts/Runtime/Utility/XChartsMgr.cs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Assets/XCharts/Runtime/Component/Main/Axis.cs b/Assets/XCharts/Runtime/Component/Main/Axis.cs index 402ad969..95822e63 100644 --- a/Assets/XCharts/Runtime/Component/Main/Axis.cs +++ b/Assets/XCharts/Runtime/Component/Main/Axis.cs @@ -495,6 +495,7 @@ namespace XCharts int split = GetSplitNumber(coordinateWidth, dataZoom); if (m_Type == AxisType.Value) { + if (minValue == 0 && maxValue == 0) return string.Empty; float value = 0; if (forcePercent) maxValue = 100; if (m_Interval > 0) @@ -635,6 +636,7 @@ namespace XCharts { if (!show) return false; if (IsCategory() && data.Count <= 0) return false; + else if (IsValue() && m_RuntimeMinValue == 0 && m_RuntimeMaxValue == 0) return false; else return true; } @@ -658,7 +660,10 @@ namespace XCharts switch (minMaxType) { case Axis.AxisMinMaxType.Default: - if (minValue > 0 && maxValue > 0) + if (minValue == 0 && maxValue == 0) + { + } + else if (minValue > 0 && maxValue > 0) { minValue = 0; maxValue = needFormat ? ChartHelper.GetMaxDivisibleValue(maxValue) : maxValue; @@ -685,6 +690,7 @@ namespace XCharts internal float GetCurrMinValue(float duration) { + if (m_RuntimeMinValue == 0 && m_RuntimeMaxValue == 0) return 0; if (!m_RuntimeMinValueChanged) return m_RuntimeMinValue; var time = Time.time - m_RuntimeMinValueUpdateTime; var total = duration / 1000; @@ -702,6 +708,7 @@ namespace XCharts internal float GetCurrMaxValue(float duration) { + if (m_RuntimeMinValue == 0 && m_RuntimeMaxValue == 0) return 0; if (!m_RuntimeMaxValueChanged) return m_RuntimeMaxValue; var time = Time.time - m_RuntimeMaxValueUpdateTime; var total = duration / 1000; diff --git a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs index 2e200a10..a0666bcc 100644 --- a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs +++ b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs @@ -886,7 +886,7 @@ namespace XCharts private void DrawYAxisTickAndSplit(VertexHelper vh, int yAxisIndex, YAxis yAxis) { - if (yAxis.show) + if (yAxis.NeedShowSplit()) { var size = yAxis.GetScaleNumber(coordinateWidth, m_DataZoom); var totalWidth = coordinateY; diff --git a/Assets/XCharts/Runtime/Utility/XChartsMgr.cs b/Assets/XCharts/Runtime/Utility/XChartsMgr.cs index be1d185a..03b74a25 100644 --- a/Assets/XCharts/Runtime/Utility/XChartsMgr.cs +++ b/Assets/XCharts/Runtime/Utility/XChartsMgr.cs @@ -25,7 +25,7 @@ namespace XCharts public class XChartsMgr : MonoBehaviour { public const string version = "1.0.5"; - public const int date = 20191204; + public const int date = 20191211; [SerializeField] private string m_NowVersion; [SerializeField] private string m_NewVersion;