-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to setup up y-axis with min, max value and a fixed step between the grid lines? #227
Comments
I identified that something goes wrong in the function What are the following lines exactly doing? Where is the var rawInterval = range / Double(labelCount)
var interval = ChartUtils.roundToNextSignificant(number: Double(rawInterval))
var intervalMagnitude = pow(10.0, round(log10(interval)))
var intervalSigDigit = (interval / intervalMagnitude) |
You can specify |
What do you mean with whatever values you want? Are these values ignored? |
It means that you specify the minimum/maximum for the Y axis like you want. I'm kind of short on time right now but I wanted to give you an answer anyway, so you should just look at the axis features, or look at the demos :-) |
If I have the time later I'll try to give you a more detailed answer |
Hi, lineChart.leftAxis.customAxisMin = max(0.0, lineChart.data!.yMin - 1.0)
lineChart.leftAxis.customAxisMax = min(10.0, lineChart.data!.yMax + 1.0)
lineChart.leftAxis.labelCount = Int(lineChart.leftAxis.customAxisMax - lineChart.leftAxis.customAxisMin)
lineChart.leftAxis.startAtZeroEnabled = false |
My issue is that few cases y axis labels are not showing. (for bar and line graphs) please help me to resolve this. |
@ramkrishna880 setLabelsToSkip(0) in your Axis |
@danielgindi cant seem to access |
Hi again never mind figured this out..
Such a marvellous plugin. You have no idea how easy you guys have made life for us developers. A Massive Thank you!! |
Hi Daniel will these properties also work for Bar chart? |
@pranavBiz2Credit can you provide code for how you set max, min & no of labels in combined chart by using axisMaximum/axisMinimum? I need to not use automatic calculation & set no of labels based on data set |
Hi,
I'm just in the learning phase of using ios-charts. I like to change the x-axis grid to fixed values.
My plotted y-values are just int numbers like 1, 2, 3,..., 10. Nevertheless the left y-axis shows values like 6.3, 9.1, etc., depending on my zoom level.
The second question is, how to setup the x-axis in order to show the labels 1,5,10,15,....40?
Is there any way to influence the step size like e.g. in Excel?
Chart (min = 6.0 and max = 10.0):
![linechartview](https://cloud.githubusercontent.com/assets/13385716/8755816/fb4f30e4-2ccd-11e5-990d-abd6fb7ecd3c.png)
The arrangement strongly depends on the min and max value.
Chart (min = 3.0 and max = 10.0):
![bildschirmfoto 2015-07-17 um 22 13 16](https://cloud.githubusercontent.com/assets/13385716/8756271/5855653a-2cd1-11e5-85de-b8799a07b8e4.png)
Thanks for your support.
The text was updated successfully, but these errors were encountered: