Line charts are the most basic charts that are created by connecting the data points with straight lines. These charts are used to visualize a trend in data as they compare values against periodic intervals such as time, temperature etc. Closing prices of a stock in a given time frame, monthly average sale of a product are some good example that can be well demonstrated through a line chart.
Line symbol chart is a slight variation of line chart and is displayed with markers on the data points. These charts are used when it is required to know the exact data points which have been used to plot the chart.
Line Chart |
Line Symbol Chart |
---|---|
Spline charts are a variation of line charts as they connect the data points using smooth curves instead of straight lines. Apart from the aesthetic aspect, these charts are preferred for displaying a gradual change in trend. Just like line chart, closing prices of a stock or life cycle of a product can be well demonstrated through a spline chart.
Spline symbol chart is a version of spline chart that is displayed with markers on the data points. These charts are used when it is required to know the exact data points which have been used to plot the chart.
Spline Chart |
Spline Symbol Chart |
---|---|
Step charts use vertical and horizontal lines to connect the data points to form a step-like progression. These charts are generally used to demonstrate the sudden change in data that might occur on irregular intervals and remains constant till the next change. These charts can be used to plot the change in commodity prices, change in tax rate against income etc.
Step symbol chart is a slight variation of step chart and is displayed with markers on the data points. These charts are used when it is required to know the exact data points which have been used to plot the chart.
Step Chart |
Step Symbol Chart |
---|---|
With FlexChart, you can create these line charts by setting the ChartType property of FlexChart class as shown in the table below. This property accepts the values from ChartType enumeration of C1.Chart namespace.
Chart Type | Value of ChartType property |
---|---|
Line | Line |
Line Symbol | LineSymbols |
Spline | Spline |
Spline Symbol | SplineSymbols |
Step | Step |
Step Symbol | StepSymbols |
FlexChart also provides option to stack and rotate the line charts. You can set the Stacking property of FlexChart class to Stacked or Stacked100pc for stacked or stacked100 line charts respectively. This property accepts the values from Stacking enumeration of C1.Chart namespace. To rotate the line chart, that is to render the X axis vertically and Y axis horizontally, you can set the Rotated property to true.
For symbol charts, by default, FlexChart renders a circular symbol and a standard size and style. However, you can change the same by setting the SymbolMarker, SymbolSize and SymbolStyle properties of the series.
To create a line chart using FlexChart:
At design-time
Using code
To create a WinForms line chart through code, the first step after initializing the control is to clear the default series and add a new series using the Add method. Set up the data source through the DataSource property and configure the X and Y axes by setting the BindingX and Binding property. You also need to set up the chart by setting the ChartType property and other required properties.
Note that the above sample code uses a custom method named GetProductRevenue to supply data. You can set up the data source as per your requirements.