How to use this sample?
Click buttons to the right of the chart to remove it in various ways.
How it works
Understanding removal option is very important if you are going to build not a simple web page with a chart,
but the Rich Internet Application. In this case you may want to create various tabs, pages with dynamic layout and so on.
Such applications require attention in such question as dynamic page content creation and removal.
chart = new AnyChartStock("AnyChartStock.swf");
As soon as you've done this there are two connected, but separate entities: AnyChartStock Object and Flash Object. (They can be disposed or created separately, but doing so you may loose the ability to work with all interactive features of AnyChart Stock component.)
In the sample you see several options: removing Flash Object only, rewriting Flash object, disposing both Chart and Flash object and recreating them.
So what's the difference between them? For better understanding we have added button states update routine, that disables some buttons, when you click any of them - this is done for demo purposes only, it may help you to understand objects life-cycle. We can't give any direct instruction when and how these options can be used - this depends heavily on application architecture, but we can give some hints:
- You may need to remove both Chart and Flash object when you reload page content and need to ensure that no junk us left in the memory;
- You may need to remove Flash object and write it again, when you want to relocate chart from one DOM object to another (say move from tab to tab);
- Removing Flash object may be used to hide chart temporarily, but it is not recommended, better use Show/Hide Method.
||Removes AnyChart Stock Flash Object from HTML DOM.
||Sets chart XML configuration file path.
||Adds the chart to HTML DOM as a child of the specified container.
This section lists all configuration, data and auxiliary files required for this sample.
- AnyChartStock.swf - AnyChart Stock component.
- Preloader.swf - AnyChart Stock helper component that loads the main component (AnyChartStock.swf) and displays loading progress.