Search tutorials
Setting the bar chart data provider
We start by creating an array for the labels and values and creating a new
instance of the DataProviderClass.
var arrLabel = new Array();
var arrValue = new Array();
var ChartData = new DataProviderClass();
We loop through each of the text fields and add their value to the labels and
values arrays. Then we add the information to the data provider and assign
field names of DataLabel and DataValue.
for (i=0; i < NumToUpdate; i++) {
arrLabel[i] = this["ChartLabel"+i].text;
arrValue[i] = this["ChartValue"+i].text;
ChartData.addItem({DataLabel:ArrLabel[i], DataValue:ArrValue[i]});
}
Finally, we link the data provider with the chart.
ThisBarChart.setDataProvider(ChartData);
ThisBarChart.setLabelSource("DataLabel");
ThisBarChart.setValueSource("DataValue");
| » Level Intermediate |
|
Added: 2002-08-05 Rating: 8 Votes: 41 |
| » Author |
| Applications Developer Marconi Australia |
| » Download |
| Download the files used in this tutorial. |
| Download (158 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!