My company is using telerik radCharts in our enterprise application. Because they will be used in many places I have made it a custom control (Pie in this case). All worked well as long as I still did the SeriesMappings in the xaml but I would like to now move that to the control as well. I have added two dependency objects to the control called XCategoryProperty and YValueProperty which tell me what field in the ItemsSource to use for displaying values on the axis. Now when I run the application instead of getting the pie chart showing data I just get a thin line. I was not sure if I need to build this series mapping somewhere besides the controls constructor. Below is a look at my xaml and also the function I call in the control's constructor:
private void BuildSeriesMapping() { SeriesMapping mapping = new SeriesMapping(); if (ChartType == Controls.ChartType.Pie) { mapping.SeriesDefinition = new PieSeriesDefinition(); } else { mapping.SeriesDefinition = new DoughnutSeriesDefinition(); } ItemMappingCollection itemMappings = new ItemMappingCollection(); ItemMapping map1 = new ItemMapping(XCategory, DataPointMember.XCategory); ItemMapping map2 = new ItemMapping(YValue, DataPointMember.YValue); ItemMapping map3 = new ItemMapping(XCategory, DataPointMember.LegendLabel); mapping.ItemMappings.Add(map1); mapping.ItemMappings.Add(map2); mapping.ItemMappings.Add(map3); this.SeriesMappings.Add(mapping); } Here are the dependency property definitions:Any help would be greatly appreciated. I have attached an image of what I get.public static readonly DependencyProperty XCategoryProperty = DependencyProperty.Register("XCategory",typeof(string),typeof(PieChart),new PropertyMetadata("XVal")); public static readonly DependencyProperty YValueProperty = DependencyProperty.Register("YValue", typeof(string), typeof(PieChart), new PropertyMetadata("YValue"));Here is the xaml:<pie:PieChart Palette="{Binding PaletteData}" x:Name="pieChart" ItemsSource="{Binding Data}" Grid.Row="0" LegendVisibility="{Binding LegendVisible}" XCategory="XVal" YValue="YVal" ChartType="Pie"/>