diff --git a/Runtime/Component/Main/Axis.cs b/Runtime/Component/Main/Axis.cs index 402ad969..95822e63 100644 --- a/Runtime/Component/Main/Axis.cs +++ b/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/Runtime/Internal/CoordinateChart.cs b/Runtime/Internal/CoordinateChart.cs index 2e200a10..a0666bcc 100644 --- a/Runtime/Internal/CoordinateChart.cs +++ b/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/Runtime/Utility/XChartsMgr.cs b/Runtime/Utility/XChartsMgr.cs index be1d185a..03b74a25 100644 --- a/Runtime/Utility/XChartsMgr.cs +++ b/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;