简体   繁体   English

WinForms 圆环图和饼图标签背景元素颜色属性

[英]WinForms Doughnut and Pie chart labels background element color property

I'm using Doughnut and Pie Charts in WinForms C# desktop application我在 WinForms C# 桌面应用程序中使用甜甜圈和饼图

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):以及属性中的BackColorBorderlineColor ,但我无法在Series (Collection) Editor属性中找到更改列出值后面的白色背景(在图像右侧,用红色箭头指向):

在此处输入图像描述

I've tried listed color properties, but none of them seems to affect this element:我试过列出颜色属性,但它们似乎都不会影响这个元素:

在此处输入图像描述

This thing is called a legend .这东西叫做传说 You can reach it using Chart.Legends property and set its BackColor :您可以使用Chart.Legends属性访问它并设置其BackColor

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM