Hi,
I have a data source which looks like following:
PerformanceSeries is a List<Series>
Series has string Name and List<Pair> as Data.
Pair is nothing but a couplet of DateTime and value.
Now as obvious from the example above the Peformance Series contains a List of Series. Each Series needs to be plotted on the Chart as line series and the name to be shown as the Legend.
In Silverlight Chart we have each Line Series having an individual Data Source. So you can Create something of the sort:
foreach(Series s in series)
{
LineSeries ls = new LineSeries();
ls.ItemsSource = s.Data;
ls.DependentValueBinding = new Binding("Value");
ls.IndependentValueBinding = new Binding("Date");
ls.Name = s.Name;
ls.Title = s.Name;
pCounters.Series.Add(ls);
}
However with the RadChart there is no Source Property exposed at the Series level. I was able to write something like this but then when i specify the source it fails completely.
foreach(Series s in series)
{
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new LineSeriesDefinition();
seriesMapping.SeriesDefinition.ShowItemToolTips = true;
ItemMapping itemMappingY = new ItemMapping();
itemMappingY.DataPointMember = DataPointMember.YValue;
itemMappingY.FieldName = "Value";
ItemMapping itemMappingX = new ItemMapping();
itemMappingX.DataPointMember = DataPointMember.XValue;
itemMappingX.FieldName = "ChartDate";
seriesMapping.ItemMappings.Add(itemMappingX);
seriesMapping.ItemMappings.Add(itemMappingY);
seriesMapping.LegendLabel = s.Name;
chart.SeriesMappings.Add(seriesMapping);
}
chart.ItemSource = series; <---- It fails here... Because of my Collection Object
So i wanted to know is it possible to specify item sources for each series added in a chart independently rather than at the whole chart level. That is in the loop above i could have easily written seriesMapping.ItemSource = s.Data;
Thanks & Regards,
Yusuf Nazami
I have a data source which looks like following:
PerformanceSeries is a List<Series>
Series has string Name and List<Pair> as Data.
Pair is nothing but a couplet of DateTime and value.
Now as obvious from the example above the Peformance Series contains a List of Series. Each Series needs to be plotted on the Chart as line series and the name to be shown as the Legend.
In Silverlight Chart we have each Line Series having an individual Data Source. So you can Create something of the sort:
foreach(Series s in series)
{
LineSeries ls = new LineSeries();
ls.ItemsSource = s.Data;
ls.DependentValueBinding = new Binding("Value");
ls.IndependentValueBinding = new Binding("Date");
ls.Name = s.Name;
ls.Title = s.Name;
pCounters.Series.Add(ls);
}
However with the RadChart there is no Source Property exposed at the Series level. I was able to write something like this but then when i specify the source it fails completely.
foreach(Series s in series)
{
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new LineSeriesDefinition();
seriesMapping.SeriesDefinition.ShowItemToolTips = true;
ItemMapping itemMappingY = new ItemMapping();
itemMappingY.DataPointMember = DataPointMember.YValue;
itemMappingY.FieldName = "Value";
ItemMapping itemMappingX = new ItemMapping();
itemMappingX.DataPointMember = DataPointMember.XValue;
itemMappingX.FieldName = "ChartDate";
seriesMapping.ItemMappings.Add(itemMappingX);
seriesMapping.ItemMappings.Add(itemMappingY);
seriesMapping.LegendLabel = s.Name;
chart.SeriesMappings.Add(seriesMapping);
}
chart.ItemSource = series; <---- It fails here... Because of my Collection Object
So i wanted to know is it possible to specify item sources for each series added in a chart independently rather than at the whole chart level. That is in the loop above i could have easily written seriesMapping.ItemSource = s.Data;
Thanks & Regards,
Yusuf Nazami