Yesterday I wrote about one of the most important objects on the new Microsoft Chart control: the chart area. Let’s check today the Series.
The idea of a data series is to store the data that is plotted to a chart area. In a chart that displays the monthly profit for a company branch for example, the object that holds the month’s collection (X-axis) and the profit amount values (Y-axis) is a data series.
There are three constructor overloads available for the Series class:
/// Expects the series name.
public Series(string name);
/// Expects the series name and the maximum number of items allowed in the Y-axis.
public Series(string name, int yValues);
The following properties are available for the Series class:
- string AxisLabel: Gets or sets the axis label text for the series;
- string ChartArea: This property specifies which chart area is going to display the current series;
- SeriesChartType ChartType: Gets or sets the chart type enumerator item for the specific series. That is probably one of the first properties that you are going to set and that defines if your series will be displayed as a column, pie, line, area chart. In the same chart area you can overlap series with different chart types. The following picture demonstrates that;
- string ChartTypeName: The property has the same function than the previous one but uses a string instead of an enumerator item;
- DataPointCustomProperties EmptyPointStyle: Gets or sets the drawing style for empty points;
- bool Enabled: Gets or sets a flag that specifies whether the series will be visible or not;
- bool IsXValueIndexed: Gets or sets a flag that specifies whether data points will be used for the X-axis values;
- string Legend: Gets or sets the name of the series associated with the legend object;
- int MarkerStep: Gets or sets a value that determines the data point markers interval;
- string Name: Gets or sets the unique name of a series;
- ChartColorPalette Palette: Gets or sets the color palette used on a series object;
- DataPointCollection Points: Read-only property used to retrieve the points from a series;
- Color ShadowColor: Gets or sets the shadow color of a series;
- int ShadowOffset: Gets or sets the shadow offset of a series (pixels);
- SmartLabelStyle SmartLabelStyle: Gets or sets the style of the smart labels;
- AxisType XAxisType: Gets or sets the X-axis type;
- string XValueMember: Gets or sets the member name of the data source used to data bind to the X-axis values;
- ChartValueType XValueType: Gets or sets the value types plotted on X-axis;
- AxisType YAxisType: Gets or sets the Y-axis type of a series;
- string YValueMembers: Gets or sets the members name of the data source used to data bind to the Y-axis values;
- int YValuesPerPoint: Gets or sets the maximum number of values allowed on the Y-axis;
- ChartValueType YValueType: Gets or sets the value types plotted on Y-axis.