This is a migrated thread and some comments may be shown as answers.

Pie Chart Label BackColors

1 Answer 159 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 26 Aug 2015, 06:48 PM

Hi,

 The label in my Pie Chart has the same backcolor as the Series.  How do I make that white?

 

Laura

1 Answer, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 27 Aug 2015, 07:46 AM
Hello Laura,

Thank you for contacting us. 

You can subscribe to the LabelFormatting event and set the BackColor and BorderColor to Color.Transparent. Here is the code snippet: 
private void Form1_Load(object sender, EventArgs e)
{
    this.radChartView1.AreaType = ChartAreaType.Pie;
    PieSeries series = new PieSeries();
    series.DataPoints.Add(new PieDataPoint(50, "Germany"));
    series.DataPoints.Add(new PieDataPoint(70, "United States"));
    series.DataPoints.Add(new PieDataPoint(40, "France"));
    series.DataPoints.Add(new PieDataPoint(25, "United Kingdom"));
    series.ShowLabels = true;
    this.radChartView1.Series.Add(series);
    this.radChartView1.View.Palette = KnownPalette.Arctic;
    this.radChartView1.LabelFormatting += radChartView1_LabelFormatting;
}
 
void radChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
{
    e.LabelElement.BackColor = Color.Transparent;
    e.LabelElement.BorderColor = Color.Transparent;
}

More information about customization of chart labels can be found on the following link: ChartView >> Customization >> Formatting Series Labels

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Ralitsa
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
Laura
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Share this question
or