Search code examples
c#winformsvisual-studio-2010.net-4.0charts

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)?


Solution

  • 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 :)