Monday, 4 November 2013

How to use CHARTS in your C# Application

Open your application via visual studio. Open ToolBox, from ToolBox under data section, You will notice Chart. drag and drop it into your Form.cs[Design].


And also drag the button into form and name it Load.
Now click on chart to open its properties window and select series.


Now Series Collection Editor will open. Under Data .. Name the Text as Age. As we want to draw the chart of Age VS Name. You can customize your chart by Appearance Properties.You can also chose what type of chart you want to use.   


Double click the Load button to open Load event. We are using Chart class and its series property. It takes collection as a parameter. Points is a property of series class. AddXY is a method of DataPointCollection class.
Copy the following code into button event .

\
Now after saving it click on start button to run it, Click the load button to load the chart.






No comments:

Post a Comment