Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Using an XML file to load Chart components
Author: Sas Jacobs
| Website: http://www.flashkit.com |
Actionscript for functions frame
The functions frame should contain the following code:
function LoadChartData() {
var BaseNode = thisXML.childNodes[0];
//set up arrays
var ArrLabel = new Array();
var ArrValue = new Array();
var ThisNode;
//create datasource
var ChartData = new DataProviderClass();
//get Chart Data
for (var i=0; i < BaseNode.childNodes.length; i++) {
ThisNode = BaseNode.childNodes[i];
ArrLabel[i] = ThisNode.attributes["ChartLabel"];
ArrValue[i] = ThisNode.attributes["ChartValue"];
ChartData.addItem({DataLabel:ArrLabel[i], DataValue:ArrValue[i]});
}
MyChart.setDataProvider(ChartData);
MyChart.setLabelSource("DataLabel");
MyChart.setValueSource("DataValue");
}
| » Level Intermediate |
|
|
Added: : 2002-08-07
Rating: 7.72 Votes: 32
Hits: 2240
|
| » Author |
|
Applications Developer
Marconi Australia
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (120 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|