我在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);
}
}
請幫助我.. 在此先感謝..