Hello Vincent,
Thank you for writing.
You can customize the chart labels by using the
LabelFormatting event. Thus, you can set the ChartViewLabelFormattingEventArgs.LabelElement.
BackColor property to Color.
Transparent. Additionally, you can customize the label's text as well.
public
Form1()
{
InitializeComponent();
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);
series.Children[0].BackColor = Color.Red;
this
.radChartView1.LabelFormatting += radChartView1_LabelFormatting;
}
private
void
radChartView1_LabelFormatting(
object
sender, ChartViewLabelFormattingEventArgs e)
{
e.LabelElement.BackColor = Color.Transparent;
PiePointElement element = (PiePointElement)e.LabelElement.Parent;
PieDataPoint dataPoint = (PieDataPoint)element.DataPoint;
e.LabelElement.Text =
string
.Format(
"{0:P}, {1}"
, dataPoint.Label, dataPoint.LegendTitle);
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Dess
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