Flex Stacked ColumnChart not showing up

birdfun

New Member
I have the following xml structure:\[code\]<root> <day name="Sun" values="21,22,25,26"/> <day name="Mon" values="27,20,22,25"/></root>\[/code\]I want it to be represented in a Column Chart with stacked bars. The first column will comprise of the columns stacked over each other with values 21,22,25 and 26 corresponding to Sunday. The length of values might change each time the dataprovider is updated.So I wrote the code like:\[code\]var columnChart:ColumnChart = new ColumnChart();columnchart.type="stacked";var yAxisData:String = "@values";var xAxisData:String = "@name";var dp:XMLListCollection = new XMLListCollection(xmlFile.day); columnchart.dataProvider = dp;var valueLength:int = dp[0][yAxisData].toString().split(",").length;for(var count:int = 0;count<valueLength;count++){var bSeries:ColumnSeries = new ColumnSeries();bSeries.dataProvider = dataProvider;bSeries.xField = xAxisData;bSeries.yField = yAxisData+"["+count+"]";columnchart.series.push(bSeries);}var hAxis:CategoryAxis = new CategoryAxis();hAxis.dataProvider = dp;hAxis.categoryField = xAxisData ; CartesianChart(columnchart).horizontalAxis = hAxis; \[/code\]But the graph is coming out to be empty. Where did I go wrong?
 
Back
Top