Completed
Last Updated: 30 Jan 2017 10:57 by ADMIN
ADMIN
Stefan
Created on: 18 Aug 2015 13:05
Category: ChartView
Type: Bug Report
1
FIX. RadChartView - setting BackColor/BorderColor to PiePointElement, causes the respective element legend item to disappear
To reproduce:

radChartView1.AreaType = ChartAreaType.Pie;
 
PieSeries series = new PieSeries();
 
series.DataPoints.Add(new PieDataPoint(50, "Germany"));
series.Children.LastOrDefault().BackColor = Color.Red;
series.Children.LastOrDefault().BorderColor = Color.Green;
 
series.DataPoints.Add(new PieDataPoint(70, "United States"));
series.Children.LastOrDefault().BackColor = Color.Green;
series.Children.LastOrDefault().BorderColor = Color.Red;
 
series.DataPoints.Add(new PieDataPoint(40, "France"));
series.Children.LastOrDefault().BackColor = Color.Blue;
series.Children.LastOrDefault().BorderColor = Color.Yellow;
 
series.DataPoints.Add(new PieDataPoint(25, "United Kingdom"));
series.Children.LastOrDefault().BackColor = Color.Yellow;
series.Children.LastOrDefault().BorderColor = Color.Blue;
 
this.radChartView1.Series.Add(series);
radChartView1.ShowLegend = true;

Workaround:
            for (int i = 0; i < radChartView1.ChartElement.LegendElement.Items.Count; i++)
            {
                PieDataPoint point = ((PieDataPoint)series.DataPoints[i]);
                radChartView1.ChartElement.LegendElement.Items[i].Element.BackColor = Color.Red;
                radChartView1.ChartElement.LegendElement.Items[i].Element.BorderColor = Color.Yellow;
            }
0 comments