Skip to content

Commit

Permalink
fix issue ChartsOrg#1830
Browse files Browse the repository at this point in the history
fix issue ChartsOrg#1830 in CombinedChartData
  • Loading branch information
songsong20100 committed May 12, 2017
1 parent 3ab1ebd commit 2b93f3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
20 changes: 20 additions & 0 deletions Source/Charts/Data/Implementations/Standard/ChartData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,26 @@ open class ChartData: NSObject
}
}

open var leftAxisMin: Double
{
return _leftAxisMin
}

open var leftAxisMax: Double
{
return _leftAxisMax
}

open var rightAxisMin: Double
{
return _rightAxisMin
}

open var rightAxisMax: Double
{
return _rightAxisMax
}

/// Adjusts the current minimum and maximum values based on the provided Entry object.
open func calcMinMax(entry e: ChartDataEntry, axis: YAxis.AxisDependency)
{
Expand Down
27 changes: 14 additions & 13 deletions Source/Charts/Data/Implementations/Standard/CombinedChartData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
}

open var lineData: LineChartData!
{
{
get
{
return _lineData
Expand All @@ -43,7 +43,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
}

open var barData: BarChartData!
{
{
get
{
return _barData
Expand All @@ -56,7 +56,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
}

open var scatterData: ScatterChartData!
{
{
get
{
return _scatterData
Expand All @@ -69,7 +69,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
}

open var candleData: CandleChartData!
{
{
get
{
return _candleData
Expand All @@ -82,7 +82,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
}

open var bubbleData: BubbleChartData!
{
{
get
{
return _bubbleData
Expand Down Expand Up @@ -137,24 +137,25 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData
_xMin = data.xMin
}

if data.yMax > _leftAxisMax

if data.leftAxisMax > _leftAxisMax
{
_leftAxisMax = data.yMax
_leftAxisMax = data._leftAxisMax
}

if data.yMin < _leftAxisMin
if data.leftAxisMin < _leftAxisMin
{
_leftAxisMin = data.yMin
_leftAxisMin = data._leftAxisMin
}

if data.yMax > _rightAxisMax
if data.rightAxisMax > _rightAxisMax
{
_rightAxisMax = data.yMax
_rightAxisMax = data._rightAxisMax
}

if data.yMin < _rightAxisMin
if data.rightAxisMin < _rightAxisMin
{
_rightAxisMin = data.yMin
_rightAxisMin = data._rightAxisMin
}
}
}
Expand Down

0 comments on commit 2b93f3f

Please sign in to comment.