Update : Check out ZedGraph C# Graph Data Export to CSV Using a Custom Context Menu , It has code to make a custom context menu item and also export the graph plot data as CSV.
Zedgraph is a very good opensource C# graph plotting library. Check out more details at my earlier post on Zedgraph. I have gone a step forward and made availabe source code and exe of a sample Zedgraph application which lets you have Line Plot, Bar Graph and Pie Chart.
Download Source Code (Visual Studio 2005 project in C#)
Below are the Screenshots of the Window Application. Copy and paste 2 columns of data from your favorite spreadsheet(eg MS Excel, Open Office Calc etc). NewLine and Tab delimiters are identified and the data is sorted accordingly, and added to graph plots. The Zedgraph plot library is so easy to use, implement and extend that it just took an afternoon to come up with this Windows application, when I was trying to convince my cousin to use ZedGraph in his college project.
ZedGraph is also being used to plot graphs in IN-Motion, a Motion Simulation Addin for Autodesk Inventor which I am co-developing along with my mentor. We are using ZedGraph to plot Postition-Velocity-Acceleration data, and intend to use it further more in Force-Torque graphs etc. Thanks to ZedGraph team for such a wonderful effort 🙂
Figure 1: ZedGraph Sample Window Application
Figure 2: The plot data for Line Plot and BarGraph are copied from a spreadsheat (eg MS Excel) and pasted in the text area. The code then uses tab and newLine delimiters to arrange data for plotting.
Figure 3: Line Plot for the above data. Notice the Titles of the X and Y axes.
Figure 4: Bargraph for the above data.
Figure 5: Data for Pie Chart. Paste 2 columns from spreadsheet. You may also use normal textbox to get the data from the user.
Figure 6: Pie Chart for the above data.