- Creating a ChartArea, it's the primary placeholder for plotting a chart.
- Creating a Series, used as a placeholder for the data points to get plotted on the chart.
- The Series Chart type must be a Line Chart.
- Points are plotted on a Series using the DataBindXY method by passing Column names and values to respective X and Y Axis of Chart, thus plotting the graph.
Using two different SQL scripts and plotting two different Line Charts. For plotting multiple chart types we need to create multiple Series also on a single Chart Area.
The output will be as below.
Some Important Properties
- Setting Chart border and BackColor.
- Setting Chart Area X and Y Axis values, enabling 3D etc.
- Show Series data points as Label text, ToolTip, set border width and Line color.
This article shows how to draw a Line chart or Multiple Line Chart by using MSChart. Hope you all liked it; the sample code is attached for download and testing the code. Post your comments and rate the article. Post your queries to our Forum Section.