|
Save and load charts |
Posted by Oliver on Mar-20-2011 06:03 |
|
Hi,
As a newcomer to Chartdirector it took me only a few hours to produce the charts I needed in my application. However I need some help to save and load the charts.
I understand I can save the charts as image file with c.makechart("c:\\example.jpg"), but I want to save the chart in a way so it can be loaded again and able to be changed (axis, labels, titles etc) and manipulated (zooming etc.). Is makechart still the right approach? How to load a chart into the WinChartViewer?
Thanks in advance for the help? |
Re: Save and load charts |
Posted by Peter Kwan on Mar-20-2011 22:34 |
|
Hi Oliver,
Currently, you can only save the output of ChartDirector, which is a chart image (in PNG, JPG, GIF, etc).
For your case, you would need to save the data and the chart configuration. They are the inputs to ChartDirector, which are provided by your code. ChartDirector does not have an API to save these information, You would need to use your own code to save the inputs. Then in future whey you would like to regenerate the chart, you can use the pass the same inputs to your charting code to regenerate the chart.
So in brief, the code structure is like:
(A) Determine the data and chart configuration information (eg. font type, size, etc) to use.
(B) Save the data and the chart configuraion information.
(C) Draw the chart with the data and chart configuration information.
In future, when you want to regenerate the chart:
(B1) Retrieve the saved data and chart configuration information
(C) Draw the chart with the data and chart configuration information.
Hope this can help.
Regards
Peter Kwan |
|