I have a barchart display the smoking counter, day by day. Each column represents one day. I would like to view the data on week, month, year, on the same graph by drag on the X-Axis. If I drag the x-axis to the right, the value on the x-axis come from month to day (smaller value scale). If I drag the x-axis to the left, the value on the x- axis come from day to month (bigger value scale).
I would like to ask: Can I make that functionality?
I am new with Core-Plot. So would you please show me how I can do that, which method, class, delegate I should implement to make that functionality.
Any help will be great appreciated.
开发者_C百科Thank you.
This question is pretty old, but quite interesting. I see two ways of dealing with it:
- Using swipe gestures
- Detect swipe gestures on the graph view;
- When one is detected, start a fade out animation to hide the graph;
- Update it (axis, plot space, reloadData, etc.) to display data in the unit that corresponds to the direction of the swipe gestures;
- Fade in.
- Using a UIScrollView
- Create a UIScrollView with 3 pages (one fore each unit);
- Display a different graph on each of these pages;
- Implement navigation between the pages (eventually using a UIPageControl).
精彩评论