HI,
I tried your suggestion but still teh chart is showing nothig:
Here is how I create the SeriesMapping:
...
List<List<StatisticsResponse>> statsDay1 = new List<List<StatisticsResponse>>();
int collectionIndex = 0;
foreach (StatisticResponseChartSerie srcs in _allStatisticsResponses)
{
string name = srcs.Name;
if (collectionIndex == 0)
name = _appResources.Get(srcs.Name);
var serie = SerieDefinition(name, srcs.Response);
serie.CollectionIndex = collectionIndex++;
_chart.SeriesMappings.Add(serie);
_displayingDataCounter++;
statsDay1.Add(srcs.Response);
}
_chart.ItemsSource = statsDay1;
...
protected SeriesMapping SerieDefinition(string serieName, List<StatisticsResponse> responses)
{
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = serieName;
if (responses.Count > 1)
{
//create a line if there is more then 1 point
seriesMapping.SeriesDefinition = new SplineSeriesDefinition();
seriesMapping.SeriesDefinition.ShowItemLabels = false;
seriesMapping.SeriesDefinition.ShowItemToolTips = true;
seriesMapping.SeriesDefinition.DefaultLabelFormat = "N0";
seriesMapping.SeriesDefinition.Appearance.StrokeThickness = 2d;
ItemMapping itemMappingY = new ItemMapping("Clicks", DataPointMember.YValue);
seriesMapping.ItemMappings.Add(itemMappingY);
}
else
{
if (responses.Any())
{
//create a bubble if there is only 1 point
BubbleSeriesDefinition bbl = new BubbleSeriesDefinition();
bbl.BubbleSizeRepresents = BubbleSizeRepresentation.Diameter;
bbl.BubbleSizeRelative = false;
seriesMapping.SeriesDefinition = bbl;
seriesMapping.SeriesDefinition.ShowItemLabels = false;
seriesMapping.SeriesDefinition.ShowItemToolTips = true;
ItemMapping yim = new ItemMapping("YValue", DataPointMember.YValue);
ItemMapping bsim = new ItemMapping("BubbleSize", DataPointMember.BubbleSize);
seriesMapping.ItemMappings.Add(yim);
seriesMapping.ItemMappings.Add(bsim);
}
}
return seriesMapping;