The process of building a chart is quite simple:
The script looks like this:
var chart = new Chart(); chart.init(); chart.image = document.getElementById('chart'); chart.useToolTips = false; chart.setProperty('titleString', 'Hello, World'); ... chart.generate();
Note that we called "chart.init()" after creating our new instance. This is an important step that users sometimes forget.
A more elegant way to build a chart would be to create a KavaChart XML data source, which looks like this. You can check this data source periodically and automatically generate your changes. The script updates the chart image within the page without refreshing the entire page. The sample code is in this directory. Since this technique requires that you retrieve your XML data from the same source as the page, we've created a working version of the sample here. You can get the full DTD for this XML here.
A DataProvider is opened using Microsoft's XMLHTTP object or XMLHttpRequest for other code bases. That request is passed to the chart object's setDataProvider function for processing. The chart object converts the XML data into a chart plus the appropriate tooltips and hyperlinks. The source code to the on-line sample is provided here, as "weather.html".