diff --git a/Charts/Classes/Data/CandleChartDataSet.swift b/Charts/Classes/Data/CandleChartDataSet.swift index b285bfc64d..92e733a987 100644 --- a/Charts/Classes/Data/CandleChartDataSet.swift +++ b/Charts/Classes/Data/CandleChartDataSet.swift @@ -29,7 +29,7 @@ public class CandleChartDataSet: BarLineScatterCandleChartDataSet public var shadowColor: UIColor? /// use candle color for the shadow - public var makeShadowSameColorAsCandle = false + public var shadowColorSameAsCandle = false /// color for open <= close public var decreasingColor: UIColor? @@ -113,6 +113,9 @@ public class CandleChartDataSet: BarLineScatterCandleChartDataSet } } + /// Is the shadow color same as the candle color? + public var isShadowColorSameAsCandle: Bool { return shadowColorSameAsCandle } + /// Are increasing values drawn as filled? public var isIncreasingFilled: Bool { return increasingFilled; } diff --git a/Charts/Classes/Renderers/CandleStickChartRenderer.swift b/Charts/Classes/Renderers/CandleStickChartRenderer.swift index 32b5bb3c12..aa12e70a3e 100644 --- a/Charts/Classes/Renderers/CandleStickChartRenderer.swift +++ b/Charts/Classes/Renderers/CandleStickChartRenderer.swift @@ -99,7 +99,7 @@ public class CandleStickChartRenderer: ChartDataRendererBase // draw the shadow var shadowColor: UIColor! = nil - if (dataSet.makeShadowSameColorAsCandle) + if (dataSet.shadowColorSameAsCandle) { if (e.open > e.close) { diff --git a/ChartsDemo/Classes/Demos/CandleStickChartViewController.m b/ChartsDemo/Classes/Demos/CandleStickChartViewController.m index 1cfe23d8ab..92a406119b 100644 --- a/ChartsDemo/Classes/Demos/CandleStickChartViewController.m +++ b/ChartsDemo/Classes/Demos/CandleStickChartViewController.m @@ -42,7 +42,7 @@ - (void)viewDidLoad @{@"key": @"saveToGallery", @"label": @"Save to Camera Roll"}, @{@"key": @"togglePinchZoom", @"label": @"Toggle PinchZoom"}, @{@"key": @"toggleAutoScaleMinMax", @"label": @"Toggle auto scale min/max"}, - @{@"key": @"toggleMakeShadowSameColorAsCandle", @"label": @"Toggle shadow same color"}, + @{@"key": @"toggleShadowColorSameAsCandle", @"label": @"Toggle shadow same color"}, ]; _chartView.delegate = self; @@ -210,11 +210,11 @@ - (void)optionTapped:(NSString *)key [_chartView notifyDataSetChanged]; } - if ([key isEqualToString:@"toggleMakeShadowSameColorAsCandle"]) + if ([key isEqualToString:@"toggleShadowColorSameAsCandle"]) { for (CandleChartDataSet *set in _chartView.data.dataSets) { - set.makeShadowSameColorAsCandle = !set.makeShadowSameColorAsCandle; + set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle; } [_chartView notifyDataSetChanged];