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 an instance of the class.

protected SeriesBase()

Properties

Index

The index of this series in the associated chart.

public int Index { get; }

Property Value

int:

The default value is -1.

ItemsSource

A collection used to generate the data points of the SeriesBase.

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

Property Value

IEnumerable

LabelAngle

The label angle.

public double LabelAngle { get; set; }

Property Value

double

LabelFormat

The label format.

public string? LabelFormat { get; set; }

Property Value

string

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

The label function.

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

Property Value

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

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

The label style.

public Style? LabelStyle { get; set; }

Property Value

Style

LabelVisibility

The label visibility.

public LabelVisibility LabelVisibility { get; set; }

Property Value

LabelVisibility

LogicalOrientation

The logical orientation of the series.

public virtual Orientation LogicalOrientation { get; }

Property Value

Orientation

Methods

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

Returns 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

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

Defines the read-only Index property.

public static readonly DependencyProperty IndexProperty

ItemsSourceProperty

Defines the ItemsSource property.

public static readonly DependencyProperty ItemsSourceProperty

Extension Methods