-
-
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 proper way to manually set chart's scale and scroll offset? #226
Comments
If the charts are the same size, and same amount of data, then calling |
Looks like Do you think change Do you consider this is a good feature to have? Not sure about others. It's more like a 'session' mechanism that can memorize the chart last state. |
OK, I found the reason! While I don't zoom the chart, the leftAxis range is [0,100], so the leftOffset is some value; however, when I zoomed, the leftAxis range becomes double digit like [40,90], so the leftOffeset is changed. @danielgindi , do you know where you change the left offset and what's the variable name? Compare below offset for 100 and 90 label: |
This is actually a recent feature that I've implemented, to prevent cases where after changing the viewport, the labels get longer and are clipped (#72). Anyway, if you want to keep the dynamic nature of the viewport, you could either:
|
I have the same problem in a LineChartView but have no idea how to salve it because your solution is for BarChart. Can you help me ? |
I find solution that helps me! Check this comment |
Say I have two view controllers in navigation view controller,
On first VC, I have a bar chart, and I zoom & scroll the chart. Then When user double tap the VC, it pushes to the second VC,
Now I want the chart to be at the same zoom & scroll status if I pop back to the first VC. What's the proper way to do so? Does ios-charts support this right now?
I am looking at
ChartViewPortHandler
, and I see functions likesetDragOffsetX()
,setDragOffsetY()
,zoom()
, but I am not sure if this can achieve my goal? It feels like such APIs are too high level for my requirement, so I am wondering is there any better way to do it?The text was updated successfully, but these errors were encountered: