i am binding list item to chat but its not working correctly.
Am getting 2 datatable , and trying to bind both on 1 chart. but it plotted wrong data.
1 dataset for 1 series and 2nd for another series.
1st Datatable having data as below which we add in 1st list.
Q1 08 | 150453000 |
Q2 08 | 158688000 |
Q4 08 | 1515 |
Q1 09 | 1000 |
2nd Datatable having data as below which we add in 2nd list.
Q4 08 | 2525 |
Q1 09 | 2000 |
1st one series its displaying correct but in 2nd there is no data for Q1 08 and Q2 08 still its plotting line chart from Q1 08 to Q2 08. it should plot from Q4 08 to Q1 09. :(
Below is my code... if somthing is missing then plz let me know.
for(int MainSeries = 0 ; MainSeries < 2 ; MainSeries ++)
{
DataTable chardata= gettingdata();
CharSeries series = gettingseries here;
List<String> lAxislabel = new List<String> ();
if(chardata!=null)
{
foreach(DataRaw drv in chardata.Rows)
{
//Adding ding values to list
lAxislabel.Add[drv[Xvalue].Tostring();
ChartSeriesItem item = new ChartSeriesItem ();
//Adding values fot chartseriesitem
item.YValue = Math.Round(double.Parce(drv[Yvalue].toString(),1);
series.item.Add(item);
}
}
if(lAxislabel.count >0 )
{
ChartAxisitem[] lsXAxis = new ChartAxisitem[lAxislabel.count];
for(int i=0;i<lAxislabel.count;i++)
{
lsXAxis [i] = new ChartAxisitem(lAxislabel[i]);
}
//objChart is chart object
objChart.Autolayout = true;
objChart.series.Add(series);
objChart.PlotArea.xAxis.AutoScale = false;
if(objChart.PlotArea.xAxis.items.count = 0)
objchart.PlotArea.xAxis.items.Addrange(lsXAxis );
objchart.PlotArea.xAxis.LayoutMode = ChartAxisLayoutMode.inside;
objChart.PlotArea.YAxis.AutoScale = true;
objchart.legend.Apperance.Visible = true.
}
}
Mainseries means 2 seres for which we are geeting data frm 2 different datatable.
may be there are some speeling mistake in above code but ignore thos ebcz am typing this code here only. above code is not cpy pasted from original code. so sorry for tthat and plzzzzzz help me... why 2nd series data is coming wrong :(