我在winform中创建Piechart.My图表即将上线。我唯一想要添加的是在Panel中显示Piechart,但我无法做到这一点。如何在Winform的面板中显示Piechart
这里是饼图的代码..
public void DrawPieChartOnForm()
{
//Take Total Five Values & Draw Chart Of These Values.
int[] myPiePercent = { 10, 20, 25, 5, 40 };
//Take Colors To Display Pie In That Colors Of Taken Five Values.
Color[] myPieColors = { Color.Red, Color.Black, Color.Blue, Color.Green, Color.Maroon };
using (Graphics myPieGraphic = this.CreateGraphics())
{
//Give Location Which Will Display Chart At That Location.
Point myPieLocation = new Point(10, 400);
//Set Here Size Of The Chart…
Size myPieSize = new Size(500, 500);
//Call Function Which Will Draw Pie of Values.
DrawPieChart(myPiePercent, myPieColors, myPieGraphic, myPieLocation, myPieSize);
}
}
请帮助我.. 在此先感谢..