Reputation: 195
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)?
Upvotes: 10
Views: 27619
Reputation: 374
I use Guna Charts regularly. It's a paid NuGet package, but it's very high quality, has animations, and is fully responsive
Upvotes: 0
Reputation: 91
well actually visual studio does have a pie chart. after dragging out the bar chart. go to your properties panel then under chart click series. a dialog box will appear after which you will select chart type. there is a whole list of different chart types to choose from
Upvotes: 9
Reputation: 171
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
Upvotes: 11
Reputation: 161
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;
Upvotes: 16
Reputation: 6434
Without third party tools the only way around it would be for you to create a new user control in WPF for this following this tutorial:
http://www.codeproject.com/Articles/28098/A-WPF-Pie-Chart-with-Data-Binding-Support
And then hosting this within the windows form project, following this tutorial:
http://www.switchonthecode.com/tutorials/wpf-tutorial-using-wpf-in-winforms
That way you have created the control yourself without the need of downloading anything, although you may need to context switch to use the WPF tutorial - I hope this is ok :)
Upvotes: 2