ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.43k stars 5.97k forks source link

how to define steps to leftAxis #5132

Open hape42 opened 7 months ago

hape42 commented 7 months ago

I am trying to create a line chart

Example

This works quite well so far. However, I cannot set the values on the left axis in 250 steps as desired.You can see my last attempt here:

ChartYAxis *leftAxis = self.lineChartView.leftAxis;
leftAxis.labelTextColor = [UIColor colorNamed:@"ColorGraphSD"];
leftAxis.axisMinimum = 0;
leftAxis.axisMaximum = ceil(maxValue / 250.0) * 250;
leftAxis.drawGridLinesEnabled = YES;
leftAxis.drawZeroLineEnabled = NO;
leftAxis.granularityEnabled = NO;
leftAxis.granularity = .1;
leftAxis.axisRange = 250;
leftAxis.labelCount = ceil(maxValue / 250.0);

Debugger tells me leftAxis.labelCount = 8; and leftAxis.axisMaximum = 2000;

All I want is a line at 259,500,750....

How to do that?