MindFusion.Charting Programmer's Guide

Creating Line Charts

A. Create a new Visual Studio Project

  • Open Visual Studio.
  • On the File menu, select New, and then choose Project.
  • Select the desired project type from the list of installed templates.
  • Type the name of your project, and click OK.

B. Create a line chart object

  • Click on the LineChart icon in the Toolbox, and drag it to the form's working area. This creates a new line chart object.
  • Click on the selection handles and expand the area of the control as desired.

C. Set the properties of the LineChart object

Note

To display properly the 3D line chart, set the Depth3D property to a value greater than zero, for example to 30.

Note

To draw the chart by using of curves, set the Curve property to true.

D. Set data for the line chart

Add XData and YData values for two series.

  • Click the XData property in the Properties window.
  • The SeriesCollection Editor appears. Add the XData values in one series. In this way, both line graphics will have the same X values.

  • Add YData values in two series

 

Note

For a line chart to be drawn, the count of members in both XData and YData lists must be equal. If the count of lists in XData is not equal to the count of lists in YData, the control cycles through them. If the count of numbers in lists at matching positions in XData and YData are not equal, the control completes the list with less values automatically.

E. Set the XAxisSettings and YAxisSettings properties

F. Set the labels of the line chart

Click in the Form area. The line chart is displayed according to the specified properties values as shown below.

Note

To draw the chart as Area3D, set LineType to Area3D.