or
SeriesMapping mySeries = new SeriesMapping();mySeries.LegendLabel = "Current Year Cash Balance";mySeries.SeriesDefinition = new SplineSeriesDefinition();mySeries.SeriesDefinition.Appearance.StrokeThickness = 3;mySeries.ItemMappings.Add(new ItemMapping("CashBalance", DataPointMember.YValue));mySeries.ItemMappings.Add(new ItemMapping("Week", DataPointMember.XCategory));secondaryChart.SeriesMappings.Add(mySeries);secondaryChart.DefaultSeriesDefinition.ShowItemLabels = false;secondaryChart.ItemsSource = cashBalanceData.Tables["currentCashBalance"];var chartArea = new ChartArea(); chartArea.LegendName = "test"; var pieSeries = new DataSeries { Definition = new PieSeriesDefinition { InteractivitySettings = {HoverScope = InteractivityScope.None, SelectionScope = InteractivityScope.Item, SelectionMode = ChartSelectionMode.Single } } }; pieSeries.Definition.ItemLabelFormat = "p";pieSeries.Add( new DataPoint() { YValue = 0.215208267, LegendLabel = "Toyota" } );pieSeries.Add( new DataPoint() { YValue = 0.192960612, LegendLabel = "General Motors" } );pieSeries.Add( new DataPoint() { YValue = 0.151830229, LegendLabel = "Volkswagen" } );pieSeries.Add( new DataPoint() { YValue = 0.125964366, LegendLabel = "Ford" } );pieSeries.Add( new DataPoint() { YValue = 0.091152353, LegendLabel = "Honda" } );pieSeries.Add( new DataPoint() { YValue = 0.079093251, LegendLabel = "Nissan" } );pieSeries.Add( new DataPoint() { YValue = 0.079093251, LegendLabel = "PSA" } );pieSeries.Add( new DataPoint() { YValue = 0.064697675, LegendLabel = "Hyundai" } ); chartArea.DataSeries.Add(pieSeries);RadChart1.DefaultView.ChartLegend.UseAutoGeneratedItems = true;RadChart1.DefaultView.ChartArea = chartArea;RadChart1.DefaultView.ChartLegend.Header = "Legend test";public partial class Example : UserControl { private bool initialized; private const string NonDbfDataField = "HugsPerCapita"; public Example() { InitializeComponent(); this.RadMap1.InitializeCompleted += new EventHandler(RadMap1_InitializeCompleted); } void RadMap1_InitializeCompleted(object sender, EventArgs e) { if (!this.initialized) { this.initialized = true; this.InformationLayer.Reader.PreviewReadCompleted += new PreviewReadShapesCompletedEventHandler(Reader_PreviewReadCompleted); } } private void Reader_PreviewReadCompleted(object sender, PreviewReadShapesCompletedEventArgs eventArgs) { if (eventArgs.Error == null) { foreach (MapShape shape in eventArgs.Items) { this.SetAdditionalData(shape); } } } private void SetAdditionalData(MapShape shape) { ExtendedData extendedData = shape.ExtendedData; if (extendedData != null) { // add new property to ExtendedData if (!extendedData.PropertySet.ContainsKey(NonDbfDataField)) { extendedData.PropertySet.RegisterProperty(NonDbfDataField, "", typeof(int), 0); } string country = (string)shape.ExtendedData.GetValue("ISO_2DIGIT"); int additionalFieldValue = this.GetHugsByCountry(country); // assign value to new property shape.ExtendedData.SetValue(NonDbfDataField, additionalFieldValue); } } private int GetHugsByCountry(string stateName) { return 43 ; } }