Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a pie chart to my winforms application?

I am trying to add a pie chart to my winforms application - but the only chart I can find in my toolbox is the regular bar chart.

Is there any way to form this bar chart as a pie chart or add a pie-chart component to my toolbox by using some existing .net 4 framework libraries (without installing any new libraries such as "DevExpress" etc)?

like image 418
AdiB Avatar asked Sep 03 '12 15:09

AdiB


2 Answers

You can change the chart type by selecting the series in property window or use the following sample code

 chart1.Series["Business"].ChartType =   
       System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
like image 65
Praveenkumar Selvaraj Avatar answered Oct 13 '22 23:10

Praveenkumar Selvaraj


In .NET 4 and later I think you have MS Chart in the framework. Read more here: http://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

like image 40
Delta Avatar answered Oct 14 '22 00:10

Delta