Hi,
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
We are using xamwebChart (line,column and bar charts). We are binding collection of series. Now I want to implement datapoint, how can I do the same.
Following is the code for series binding:
foreach (ControlSeries Series in ListControlSeries)
{
#region Dynamic Series
//Setting xCol and yCol and Serice
Infragistics.Silverlight.Chart.Series MySeries = new Infragistics.Silverlight.Chart.Series();
MySeries.DataMapping = "Value=" + Control.xCol + ";Label=" + Control.yCol;
MySeries.ChartType = Infragistics.Silverlight.Chart.ChartType.Line;
MySeries.Label = Series.Value.ToString();
//Default Animation
Animation a = new Animation();
MySeries.Animation = a;
_XamLineChart.Series.Add(MySeries);
#endregion
var dataSource = (from d in doc.Descendants(XML_ELM_GROUP_FIELD).Descendants(XML_ELM_DATA)
where d.Parent.Parent.Parent.Attribute(XML_ATR_CONTROL_NAME).Value == Convert.ToString(_XamLineChart.Tag).Trim() &&
d.Parent.Attribute(groupByAttribute).Value == Series.Value
select new ChartDataMapper
Value = (double)d.Attribute(xCol),
Name = (string)d.Attribute(yCol).Value
}).ToList<ChartDataMapper>();
_XamLineChart.Series[i].DataSource = dataSource;
_XamLineChart.Series[i].Label = Series.Value;
i++;
}
Thanks
Hello Asit,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you this link from our online documentation:
http://help.infragistics.com/NetAdvantage/Silverlight/2011.1/CLR4.0/?page=xamWebChart_DataMapping_for_xamChart.html
where it is explained how to make the mapping between the XamWebChart and the DataSource.
Feel free to write me if you have further questions.