-
-
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
What's the differences between setAxisMaximum and customAxisMax #239
Comments
Once you set customAxisMax/Max, it just defines the max range of the axis, so you cannot zoom out I guess if you are not zoomed in first. Because if you try to zoom out the max range, what the range would be is unknown. I don't know android, @PhilJay can you confirm? axisMaximum/Min is something calculated via Once you set customAxisMax/Max, axisMax/Min is set to it: _yAxis.axisMaximum = !isnan(_yAxis.customAxisMax) ? _yAxis.customAxisMax : maxLeft + Double(topSpaceLeft)
_yAxis.axisMinimum = !isnan(_yAxis.customAxisMin) ? _yAxis.customAxisMin : minLeft - Double(bottomSpaceLeft) |
|
|
I don't believe you can zoom out of the max axis range... But zoom in seems possible to a very small scale, but I never tried it infinitely. What are you trying to do here? You can try to modify the scaleX/Y to let X:Y = 1:3, I am not very clear about what you needs. customAxisMax/min means you define the max/min, instead of calculating. When you add point to dataSet, axis max/min are calculated with these values already. |
I used the following line of codes to zoom in by programatically for example to show just the min and max value of the data. Nevertheless, I haven't tried whether it is still possible to zoom in/out by the gestures. 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 |
For those who find an issue of not having the customAxisMin/Max working, bare in mind that the dataSet should be added to the graph after. |
After init a linecharview like this
I find 4 properies :
the _lineChart yAxis is from -1 to +1 and it just can zoom in can not zoom out
and can not zoom and move in x direction
i have run a demo in android , the chat can zoom and move freely
The text was updated successfully, but these errors were encountered: