|
How to zoom a Bar chart and Pie chart? |
Posted by Jeremy on Jan-08-2016 17:06 |
|
Dear Peter,
Assume I have a chart draw both bar and a line. (like the attachment show).
Here is my questions:
1. How can I make this kind of chart zoomable?
I know for there are some function in ViewPortmanager, "syncLinearAxisWithViewPort",
"syncLogAxisWithViewPort" & "syncDateAxisWithViewPort", but these function seems not
suitable for such "Lable" X-axis based chart.
Which function should I use to make chart zoom/drag?
what's these function calling steps?
2. Also my chart is a mutiple axis, how to make these zoom apply to both axis?
3. Can we zoom/drag a "Pie" chart?
Appreciate to your answer,
Thanks,
Jeremy
|
Re: How to zoom a Bar chart and Pie chart? |
Posted by Peter Kwan on Jan-09-2016 04:56 |
|
Hi Jeremy,
To make the chart zoomable, for the y-axis (if you allow zoom in the y direction), you
may use syncLinearAxisWithViewPort. If you have 2 y-axes, you may repeat the sync
code to sync both of them.
For the x-axis, if the x-axis labels are just an array of names, there are several
methods. Attached please find a C++ example that shows one way of doing this.
For zooming a pie chart, the only meaning I can think of is a graphical zoom.
A graphical zoom is like zooming a photograph - everything becomes bigger. A data zoom-
in is like zooming a map. It displays more detail (more data), and the data can change,
such as from terrian map to street map when zooming in. However, the objects do not
necessary become bigger. The viewport system is designed for data level zoom.
If you need to zoom a pie chart, may be you can just make a bigger pie chart and then use
some MFC control to display a part of it. (I think you may be able to find examples in the
Internet for zooming in a photograph. You can then use the same code to zoom in a pie
chart.
Hope this can help.
Regards
Peter Kwan
|
Re: How to zoom a Bar chart and Pie chart? |
Posted by Jeremy on Jan-11-2016 09:43 |
|
Hi Peter,
Thank for your answer.
I get what you mean about zooming the Pie Chart.
And I will learn how to deal with label string base axis from your example.
Thanks again!.
Thanks,
Jeremy |
|