Page 1 of 1

Problem w/ restoring tchart state from a saved string

Posted: Fri Mar 12, 2004 3:54 pm
by 9078543
We use the export and import "asNative" capabilities of TChart in order to implement a cancel button to get the user back to a known state. Unfortunately certain changes don't seem to be undone. We have found several cases of this, although we don't feel like this is all of them. As a workaround for now, is there any way to reset a tchart control back to the initial state? Is there something wrong with our techinque?

I've included a sample .xls file at
http://www.phoenix-int.com/~nsharp/teeC ... roblem.xls
To use it, load it up and press the "Setup Chart" button, which will
initialize the chart to a known state and saves off a copy of the settings into a class variable. Use the "Make Changes" button to make some minor modifications to the look of the chart. Then press the "Cancel Changes" button, which loads in the saved state from the first step. Some of the changes will be cancelled, others will not.

1) If a header exists originally and is removed, it will be put back into place by the cancel button. The other way around doesn't work - if you have no title and then add one, the cancel button will not remove the title.
2) If a background image is added, it will not be removed by the cancel.
3) If a the legend is removed, it will not be re-added

Thanks again.

Posted: Tue Mar 16, 2004 12:12 pm
by Chris
Hi Pheonix,

Have you tried using the ITChart.ClearChart method to reset the chart control?