Skip to content

Commit

Permalink
Makes ChartsDemo compiling again (#3117)
Browse files Browse the repository at this point in the history
* Use example drawEntryLabelsEnabled instead of removed drawSliceTextEnabled

* Use in example ILineChartDataSet.mode property instead of removed drawSteppedEnabled one
  • Loading branch information
valeriyvan authored and liuxuan30 committed Dec 19, 2017
1 parent ecdd295 commit 5639818
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ChartsDemo/Objective-C/Demos/HalfPieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleXValues"])
{
_chartView.drawSliceTextEnabled = !_chartView.isDrawSliceTextEnabled;
_chartView.drawEntryLabelsEnabled = !_chartView.drawEntryLabelsEnabled;

[_chartView setNeedsDisplay];
return;
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChart1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChart2ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
9 changes: 8 additions & 1 deletion ChartsDemo/Objective-C/Demos/LineChartTimeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,14 @@ - (void)optionTapped:(NSString *)key
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
{
set.drawSteppedEnabled = !set.isDrawSteppedEnabled;
switch (set.mode) {
case LineChartModeLinear:
case LineChartModeCubicBezier:
case LineChartModeHorizontalBezier:
set.mode = LineChartModeStepped;
break;
case LineChartModeStepped: set.mode = LineChartModeLinear;
}
}

[_chartView setNeedsDisplay];
Expand Down
2 changes: 1 addition & 1 deletion ChartsDemo/Objective-C/Demos/PieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleXValues"])
{
_chartView.drawSliceTextEnabled = !_chartView.isDrawSliceTextEnabled;
_chartView.drawEntryLabelsEnabled = !_chartView.drawEntryLabelsEnabled;

[_chartView setNeedsDisplay];
return;
Expand Down

0 comments on commit 5639818

Please sign in to comment.