In This Article

SeriesBase Class

Provides the base class for a series.

[StyleTypedProperty(Property = "LabelStyle", StyleTargetType = typeof(DataPointLabel))]
public abstract class SeriesBase : Control
Inheritance:
object Visual UIElement FrameworkElement Control object
Derived:
XYSeriesBase

Constructors

SeriesBase()

Initializes a new instance of the SeriesBase class.

protected SeriesBase()

Properties

Index

Gets the index of this series in the associated chart. This is a dependency property.

public int Index { get; }

Property Value

int:

The index of this series in the associated chart. The default value is -1.

ItemsSource

Gets or sets a collection used to generate the data points of the SeriesBase. This is a dependency property.

[TypeConverter(typeof(SeriesItemsSourceConverter))]
public IEnumerable ItemsSource { get; set; }

Property Value

IEnumerable:

A collection used to generate the data points of the SeriesBase. The default value is null.

LabelAngle

Gets or sets the label angle.

public double LabelAngle { get; set; }

Property Value

double:

The label angle.

LabelFormat

Gets or sets the label format.

public string LabelFormat { get; set; }

Property Value

string:

The label format.

Remarks

The format string will be passed the following parameters:

  • {0} is the value on the primary axis.
  • {1} is the value on the secondary axis.
  • {2} is the value on the X axis.
  • {3} is the value on the Y axis.
The format is ignored if LabelFunc is specified.

LabelFunc

Gets or sets the label function.

public Func<object, object, object, object, object, string> LabelFunc { get; set; }

Property Value

Func<object, object, object, object, object, string>:

The label function.

Remarks

This is a Func that determines what the label text will be. The parameters are primary axis value, secondary axis value, X axis value, Y axis value, and original value.

LabelStyle

Gets or sets the label style.

public Style LabelStyle { get; set; }

Property Value

Style:

The label style.

LabelVisibility

Gets or sets the label visibility.

public LabelVisibility LabelVisibility { get; set; }

Property Value

LabelVisibility:

The label visibility.

LogicalOrientation

Gets the logical orientation of the series.

public virtual Orientation LogicalOrientation { get; }

Property Value

Orientation

Methods

GetLabelText(object, object, object, object, object)

Gets the label text.

protected virtual string GetLabelText(object primaryValue, object secondaryValue, object xValue, object yValue, object originalValue)
Parameter Type Description
primaryValue object

The primary value.

secondaryValue object

The secondary value.

xValue object

The x value.

yValue object

The y value.

originalValue object

The original value.

Returns

string:

The text to apply to the label.

OnItemsSourceChanged(IEnumerable, IEnumerable)

Occurs when the ItemsSource value is changed.

protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameter Type Description
oldValue IEnumerable

Old value of the ItemsSource property.

newValue IEnumerable

New value of the ItemsSource property.

OnItemsSourceCollectionChanged(object, NotifyCollectionChangedEventArgs)

Handles the CollectionChanged event of the ItemsSource collection.

protected virtual void OnItemsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameter Type Description
sender object

The source of the event.

e NotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs instance containing the event data.

Refresh()

Updates the series based on the current state.

public abstract void Refresh()

Fields

IndexProperty

Identifies the read-only Index dependency property. This field is read-only.

public static readonly DependencyProperty IndexProperty

ItemsSourceProperty

Identifies the ItemsSource dependency property. This field is read-only.

public static readonly DependencyProperty ItemsSourceProperty