WinForms Doughnut and Pie chart labels background element color property

Viewed 303

I'm using Doughnut and Pie Charts in WinForms C# desktop application

I change the color for section this way:

chart1.Series[0].Points[i1].Color = Color.Yellow;

as well as for BackColor and BorderlineColor from properties, but I can't find in Series (Collection) Editor property to change white background behind listed values (on right side on image, pointed with red arrow):

enter image description here

I've tried listed color properties, but none of them seems to affect this element:

enter image description here

1 Answers

This thing is called a legend. You can reach it using Chart.Legends property and set its BackColor:

//by index
chart1.Legends[0].BackColor = Color.Black;
//by name through series object
chart1.Legends[chart1.Series[0].Legend].BackColor = Color.Red;
Related