From 8e1bcbd8ed33e153b90b30dc20446b5965fc6727 Mon Sep 17 00:00:00 2001 From: liuxuan30 Date: Thu, 22 Oct 2015 10:01:33 +0800 Subject: [PATCH] if only line data exists and no other data, turn _deltaX to 1.0, just like what LineChartView did --- Charts/Classes/Charts/CombinedChartView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Charts/Classes/Charts/CombinedChartView.swift b/Charts/Classes/Charts/CombinedChartView.swift index b1a7c2cfb0..7dbcd23911 100644 --- a/Charts/Classes/Charts/CombinedChartView.swift +++ b/Charts/Classes/Charts/CombinedChartView.swift @@ -74,6 +74,10 @@ public class CombinedChartView: BarLineChartViewBase, LineChartDataProvider, Bar _deltaX = CGFloat(abs(_chartXMax - _chartXMin)) } + if (_deltaX == 0.0 && self.lineData?.yValCount > 0) + { + _deltaX = 1.0 + } } public override var data: ChartData?