Skip to content

Commit a6baa45

Browse files
committed
Add x-axis limit line example to demo app.
1 parent fdcc5de commit a6baa45

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ChartsDemo/Classes/Demos/LineChart1ViewController.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ - (void)viewDidLoad
5757
_chartView.pinchZoomEnabled = YES;
5858
_chartView.highlightIndicatorEnabled = NO;
5959

60+
// x-axis limit line
61+
ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.f label:@"Index 10"];
62+
llXAxis.lineWidth = 4.f;
63+
llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)];
64+
llXAxis.labelPosition = ChartLimitLabelPositionRight;
65+
llXAxis.valueFont = [UIFont systemFontOfSize:10.f];
66+
67+
[_chartView.xAxis addLimitLine:llXAxis];
68+
6069
ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:130.f label:@"Upper Limit"];
6170
ll1.lineWidth = 4.f;
6271
ll1.lineDashLengths = @[@5.f, @5.f];

0 commit comments

Comments
 (0)