This question is locked. New answers and comments are not allowed.
Hello all
We've a chart not the datasource is changing, seriser is changing, therefore we don't assign the ItemsSource in Xaml for the chart,only has the declaration in xaml.
In codebehind we create a SeriesMappingCollection and everthing in it and assign the itemsource to very SeriesMapping, at the code bottom assign the collection back to SeriesMappings But straged that Page shows "No data serier to me" when load.
Any ideas and suggestions?
Xaml
Create Chart method
Result see attached
We've a chart not the datasource is changing, seriser is changing, therefore we don't assign the ItemsSource in Xaml for the chart,only has the declaration in xaml.
In codebehind we create a SeriesMappingCollection and everthing in it and assign the itemsource to very SeriesMapping, at the code bottom assign the collection back to SeriesMappings But straged that Page shows "No data serier to me" when load.
Any ideas and suggestions?
Xaml
<chart:RadChart x:Name="radChart" Grid.Row="1" Style="{StaticResource RadChartStyle}" />Create Chart method
private void GenerateChartData(RadChart chart, List<IEnumerable<ChartObject>> CollectionData1) { SeriesMappingCollection seriesMappingCollection = new SeriesMappingCollection(); string[] names = new string[] { "Apple" }; List<ChartObject> items = new List<ChartObject>(){ new ChartObject("AA1",200), new ChartObject("AA2", 300), new ChartObject("AA3", 400), new ChartObject("Estimate11", 600)}; for (int i = 0; i < 1; i++) { SeriesMapping seriesMapping = new SeriesMapping(); seriesMapping.LegendLabel = names[i]; StackedBar100SeriesDefinition stackedBar100 = new StackedBar100SeriesDefinition(); stackedBar100.ShowItemLabels = true; stackedBar100.ShowItemToolTips = true; stackedBar100.StackGroupName = "Sourcing"; stackedBar100.ItemToolTipFormat = "#STPERCENT{#0.#%}"; stackedBar100.InteractivitySettings = new InteractivitySettings(); stackedBar100.InteractivitySettings.SelectionMode = Telerik.Windows.Controls.Charting.ChartSelectionMode.Multiple; stackedBar100.InteractivitySettings.SelectionScope = InteractivityScope.Item; stackedBar100.InteractivitySettings.HoverScope = InteractivityScope.Item; stackedBar100.SeriesName = names[i]; seriesMapping.SeriesDefinition = stackedBar100; seriesMapping.ItemMappings.Add(new ItemMapping("Type", DataPointMember.XCategory)); seriesMapping.ItemMappings.Add(new ItemMapping("Count", DataPointMember.YValue)); seriesMapping.ItemMappings.Add(new ItemMapping("CustomLabel", DataPointMember.Label)); seriesMapping.ItemsSource = items; seriesMappingCollection.Add(seriesMapping); } chart.SeriesMappings = seriesMappingCollection; }Result see attached