Skip to content
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

Scale to particular x-axis range in line chart #2979

Closed
rameswarprasad opened this issue Nov 12, 2017 · 1 comment
Closed

Scale to particular x-axis range in line chart #2979

rameswarprasad opened this issue Nov 12, 2017 · 1 comment

Comments

@rameswarprasad
Copy link

rameswarprasad commented Nov 12, 2017

Hi, I searched for a similar query and I believe it exist somewhere but somehow didn't get the right result so creating a new issue. Please mark duplicate if already asked (I believe which is for sure).

So let's say I have years of financial data which is represented through multiple datasets in a line chart. Now though I may have years of data but initially the charts needs to show 1 day or a weeks (past week) data. The user can then simply drag through x-axis, or pan and it will keep continuing to show with that filter-on like if 1 day option is selected then just keep showing the range of 1 day or a weeks data plotted if a week filter is selected while dragging.

Currently whenever I'm setting the data sets the chart zooms out and shows all the data from the first data point till the last one and after using pan gesture or scaling up with gestures user is able to drag and look into more details. Can you please tell how to directly show a default range on the chart instead of showing all the data.

And then again I have a follow up question with that, when user scales to a 1 day range I have to show time labes instead of date labels on the x-axis. How to go about the data structure and update the chart from it dynamically when a user is pinching and panning?

The behavior of the chart is pretty much similar to Yahoo! Finance iOS app.

@liuxuan30
Copy link
Member

liuxuan30 commented Nov 15, 2017

there is api like setVisibleX/YRange() to limit how many entries can show up.
also apis like setRoomX/Y. some advanced apis like restrainViewPort and refreshing apis like refresh(newMatrix: CGAffineTransform, chart: ChartViewBase, invalidate: Bool).

I feel you can just take a look at ChartTransFormer and ViewPortHandler apis about advanced controls of scaling and translating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants