我试图写一个Windows应用程序,显示有七个不等片(25%,20%,18%,17%,10%,10%,10%),他们都将被不同颜色的饼图。
到目前为止,我已经做画笔和画刷附和画出的圆圈的颜色。
这是我到目前为止
private void Form1_Paint(object sender, PaintEventArgs e)
{
this.BackColor = Color.White;
this.Text = "Pie Chart";
this.Width = 350;
this.Height = 350;
Pen black = new Pen(Color.Black);
Pen blue = new Pen(Color.Blue);
Pen green = new Pen(Color.Green);
Pen red = new Pen(Color.Red);
Pen orange = new Pen(Color.Orange);
Pen pink = new Pen(Color.Pink);
Pen purple = new Pen(Color.Purple);
Pen magenta = new Pen(Color.Purple);
Brush brBlue = blue.Brush;
Brush brGreen = green.Brush;
Brush brRed = red.Brush;
Brush brOrange = orange.Brush;
Brush brPink = pink.Brush;
Brush brPurple = purple.Brush;
Brush brMagenta = magenta.Brush;
Graphics g = e.Graphics;
g.DrawEllipse(black, 20, 10, 300, 300);
}
我对你的问题。 什么是绘制饼图楔形的最简单的方法?