Xceed Chart for WinForms v4.4 Documentation
One Value Series Functionality

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Series > One Value Series Functionality

All series, which require one or more value data series, are derived from the Series class. The Series class is derived from the SeriesBase class and inherits all the basic series functionality. The Series class extends this functionality with the following features:

Values Data Series

A data series containing double values. It is accessible through the Values property of the Series object.

Labels Data Series

A data series containing string values. It is accessible through the Labels property of the Series object.

Appearance Control

The user can apply individual filling and borders for each data point, but can also use the ambient series filling and border. This functionality is exposed to the user with the help of the Appearance object, which is accessible through the Appearance property of the Series object. See the Appearance topic for more information.

Data Labels

Data labels are texts displayed on data points. The user can easily control the information displayed by them with a simple format string. See the Data Labels topic for more information.

Markers

Markers are shapes displayed on each data point. The user can easily control their properties with the help of a Markers object which is accessible through the Markers property of the Series object. See the Markers topic for more information.

Helper Methods for Inserting Values in the Data Series

Helper methods are available for inserting the following information in the respective data series:

value
value, label
value, label, fill effect
value, label, fill effect, line properties

The following examples demonstrate the four overrides of the Add method.

1. Add value only.

VB.NET  

series.Add(10)

series.Add(20)

series.Add(15)

C#  
series.Add(10);
series.Add(20);
series.Add(15);

2. Add values and labels and display the labels in the data labels and legend.

VB.NET  

series.Add(10, "Apples")

series.Add(20, "Oranges")

series.Add(15, "Bananas")

 

series.DataLabels.Format = "<value> <label>"

series.Legend.Mode = SeriesLegendMode.DataPoints

series.Legend.Format = "<value> <label>"

C#  
series.Add(10, "Apples");
series.Add(20, "Oranges");
series.Add(15, "Bananas");
series.DataLabels.Format = "<value> <label>";
series.Legend.Mode = SeriesLegendMode.DataPoints;
series.Legend.Format = "<value> <label>";

3. Add values, labels and fill effects and display the data points in the specified colors.

VB.NET  

series.Add(23, "Item1", New FillEffect(Color.Chocolate))

series.Add(67, "Item2", New FillEffect(Color.Blue))

series.Add(78, "Item3", New FillEffect(Color.Coral))

 

series.Appearance.FillMode = AppearanceFillMode.DataPoints

C#  
series.Add(23, "Item1", new FillEffect(Color.Chocolate));
series.Add(67, "Item2", new FillEffect(Color.Blue));
series.Add(78, "Item3", new FillEffect(Color.Coral));
series.Appearance.FillMode = AppearanceFillMode.DataPoints;

4. Add values, labels, fill effects and line properties and display the data points with the specified fill colors and line properties.

VB.NET  

series.Add(23, "Item1", New FillEffect(Color.Chocolate), New LineProperties(1, Color.Black))

series.Add(67, "Item2", New FillEffect(Color.Blue), New LineProperties(1, Color.Green))

series.Add(78, "Item3", New FillEffect(Color.Coral), New LineProperties(1, Color.Red))

 

series.Appearance.FillMode = AppearanceFillMode.DataPoints

series.Appearance.LineMode = AppearanceLineMode.DataPoints

C#  
series.Add(23, "Item1", new FillEffect(Color.Chocolate), new LineProperties(1, Color.Black));
series.Add(67, "Item2", new FillEffect(Color.Blue), new LineProperties(1, Color.Green));
series.Add(78, "Item3", new FillEffect(Color.Coral), new LineProperties(1, Color.Red));
series.Appearance.FillMode = AppearanceFillMode.DataPoints;
series.Appearance.LineMode = AppearanceLineMode.DataPoints;

Formatting Commands

The Series class implements support for the following formatting commands, which can be specified in the DataLabels.Format and SeriesLegend .Format properties: 

<value> - The current data point value (extracted from the Values data series).

<label> - The current data point label (extracted from the Labels data series).

<total> - The total sum of the values contained in the Values series.

<percent> - The percentage of the current data point value to the total value.

<cumulative> - The cumulative sum accumulated up to this data point.

<index> - The index of the data point inside the values data series. 

For example, if you want to display the value and label of a bar data point in its data label, you will have to write the following code:

VB.NET  
series.DataLabels.Format = "<value> <label>"
C#  
series.DataLabels.Format = "<value> <label>";

Analogously, you can instruct the legend to show the percent and total in the data point legend texts with the following code:

VB.NET  
series.Legend.Format = "<percent> <total>"
C#  
series.Legend.Format = "<percent> <total>";

See Also

Series | Appearance | DataLabels | Markers | SeriesLegend | Series Appearance | Series Data Labels | Series Markers