SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
//Fill Serie with Provider color
if (_item_index != -1)
{
seriesMapping.SeriesDefinition.Appearance.Fill = chart_Provider.PaletteBrushes[_item_index % 10];
_item_index = -1;
}
ItemMapping yMapping = new ItemMapping("quantity", DataPointMember.YValue);
ItemMapping catMapping = new ItemMapping("period", DataPointMember.XCategory);
seriesMapping.ItemMappings.Add(yMapping);
seriesMapping.ItemMappings.Add(catMapping);
chart_Months.SeriesMappings.Add(seriesMapping);
chart_Months.ItemsSource = e.Result.ToList();
after that, if the user click in a list that I have in my page, I'm adding a new SplineSeriesDefinition to the existing graph, so I'm doing this calling to another WCF service:
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition =
new SplineSeriesDefinition();
ItemMapping yMapping = new ItemMapping("quantity", DataPointMember.YValue);
ItemMapping catMapping = new ItemMapping("period", DataPointMember.XCategory);
seriesMapping.ItemMappings.Add(yMapping);
seriesMapping.ItemMappings.Add(catMapping);
chart_Months.SeriesMappings.Add(seriesMapping);
I'm doing something wrong with the series because the second series shows me the same values of the first one. My first series has for example cost grouped by a, b and c, my second serie shows only cost grouped by a. I can´t load everything and then hide a serie because I don't know wich one is going to be selected
Could you please tells me how to do this?
By the way, I'm using a PaletteBrushes for my first serie, if I'm generating my second serie, sometimes depending on the color is using the same color for both series, is there any way to avoid this?
Thank you very much