Skip to content

Commit

Permalink
Move on from the deprecated property in the demos
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Sep 21, 2016
1 parent 7169680 commit 9b62336
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 26 deletions.
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/DemoBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ - (void)setupPieChartView:(PieChartView *)chartView
chartView.highlightPerTapEnabled = YES;

ChartLegend *l = chartView.legend;
l.position = ChartLegendPositionRightOfChart;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationVertical;
l.drawInside = NO;
l.xEntrySpace = 7.0;
l.yEntrySpace = 0.0;
l.yOffset = 0.0;
Expand Down
14 changes: 9 additions & 5 deletions ChartsDemo/Classes/Demos/BarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ - (void)viewDidLoad
rightAxis.spaceTop = 0.15;
rightAxis.axisMinimum = 0.0; // this replaces startAtZero = YES

_chartView.legend.position = ChartLegendPositionBelowChartLeft;
_chartView.legend.form = ChartLegendFormSquare;
_chartView.legend.formSize = 9.0;
_chartView.legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
_chartView.legend.xEntrySpace = 4.0;
ChartLegend *l = _chartView.legend;
l.horizontalAlignment = ChartLegendHorizontalAlignmentLeft;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.form = ChartLegendFormSquare;
l.formSize = 9.0;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
l.xEntrySpace = 4.0;

XYMarkerView *marker = [[XYMarkerView alloc]
initWithColor: [UIColor colorWithWhite:180/255. alpha:1.0]
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/BubbleChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ - (void)viewDidLoad
_chartView.pinchZoomEnabled = YES;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionRightOfChart;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationVertical;
l.drawInside = NO;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];

ChartYAxis *yl = _chartView.leftAxis;
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/CombinedChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ - (void)viewDidLoad

ChartLegend *l = _chartView.legend;
l.wordWrapEnabled = YES;
l.position = ChartLegendPositionBelowChartCenter;
l.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;

ChartYAxis *rightAxis = _chartView.rightAxis;
rightAxis.drawGridLinesEnabled = NO;
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/HalfPieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ - (void)viewDidLoad
_chartView.centerTextOffset = CGPointMake(0.0, -20.0);

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionAboveChartCenter;
l.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.xEntrySpace = 7.0;
l.yEntrySpace = 0.0;
l.yOffset = 0.0;
Expand Down
14 changes: 9 additions & 5 deletions ChartsDemo/Classes/Demos/HorizontalBarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ - (void)viewDidLoad
rightAxis.drawGridLinesEnabled = NO;
rightAxis.axisMinimum = 0.0; // this replaces startAtZero = YES

_chartView.legend.position = ChartLegendPositionBelowChartLeft;
_chartView.legend.form = ChartLegendFormSquare;
_chartView.legend.formSize = 8.0;
_chartView.legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
_chartView.legend.xEntrySpace = 4.0;
ChartLegend *l = _chartView.legend;
l.horizontalAlignment = ChartLegendHorizontalAlignmentLeft;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.form = ChartLegendFormSquare;
l.formSize = 8.0;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
l.xEntrySpace = 4.0;

_chartView.fitBars = YES;

Expand Down
12 changes: 8 additions & 4 deletions ChartsDemo/Classes/Demos/LineChart2ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ - (void)viewDidLoad

_chartView.backgroundColor = [UIColor colorWithWhite:204/255.f alpha:1.f];

_chartView.legend.form = ChartLegendFormLine;
_chartView.legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
_chartView.legend.textColor = UIColor.whiteColor;
_chartView.legend.position = ChartLegendPositionBelowChartLeft;
ChartLegend *l = _chartView.legend;
l.form = ChartLegendFormLine;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:11.f];
l.textColor = UIColor.whiteColor;
l.horizontalAlignment = ChartLegendHorizontalAlignmentLeft;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;

ChartXAxis *xAxis = _chartView.xAxis;
xAxis.labelFont = [UIFont systemFontOfSize:11.f];
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/MultipleBarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ - (void)viewDidLoad
_chartView.marker = marker;

ChartLegend *legend = _chartView.legend;
legend.position = ChartLegendPositionRightOfChartInside;
legend.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
legend.verticalAlignment = ChartLegendVerticalAlignmentTop;
legend.orientation = ChartLegendOrientationVertical;
legend.drawInside = YES;
legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:8.f];
legend.yOffset = 0.0;
legend.yEntrySpace = 0.0;
Expand Down
6 changes: 5 additions & 1 deletion ChartsDemo/Classes/Demos/MultipleLinesChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ - (void)viewDidLoad
[_chartView setScaleEnabled:YES];
_chartView.pinchZoomEnabled = NO;

_chartView.legend.position = ChartLegendPositionRightOfChart;
ChartLegend *l = _chartView.legend;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationVertical;
l.drawInside = NO;

_sliderX.value = 20.0;
_sliderY.value = 10.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ - (void)viewDidLoad
_chartView.rightAxis.labelFont = [UIFont systemFontOfSize:9.f];

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionBelowChartRight;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.formSize = 8.f;
l.formToTextSpace = 4.f;
l.xEntrySpace = 6.f;
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/PieChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ - (void)viewDidLoad
_chartView.delegate = self;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionRightOfChart;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationVertical;
l.drawInside = NO;
l.xEntrySpace = 7.0;
l.yEntrySpace = 0.0;
l.yOffset = 0.0;
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/RadarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ - (void)viewDidLoad
yAxis.drawLabelsEnabled = NO;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionAboveChartCenter;
l.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
l.xEntrySpace = 7.0;
l.yEntrySpace = 5.0;
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/ScatterChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ - (void)viewDidLoad
_chartView.pinchZoomEnabled = YES;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionRightOfChart;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentTop;
l.orientation = ChartLegendOrientationVertical;
l.drawInside = NO;
l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
l.xOffset = 5.0;

Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/SinusBarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ - (void)viewDidLoad
rightAxis.granularity = 0.1;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionBelowChartLeft;
l.horizontalAlignment = ChartLegendHorizontalAlignmentLeft;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.form = ChartLegendFormSquare;
l.formSize = 9.0;
l.font = [UIFont systemFontOfSize:11.f];
Expand Down
5 changes: 4 additions & 1 deletion ChartsDemo/Classes/Demos/StackedBarChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ - (void)viewDidLoad
xAxis.labelPosition = XAxisLabelPositionTop;

ChartLegend *l = _chartView.legend;
l.position = ChartLegendPositionBelowChartRight;
l.horizontalAlignment = ChartLegendHorizontalAlignmentRight;
l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
l.orientation = ChartLegendOrientationHorizontal;
l.drawInside = NO;
l.form = ChartLegendFormSquare;
l.formSize = 8.0;
l.formToTextSpace = 4.0;
Expand Down

0 comments on commit 9b62336

Please sign in to comment.