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.
ItemsSource
A collection used to generate the data points of the SeriesBase.
[TypeConverter(typeof(SeriesItemsSourceConverter))]
public IEnumerable? ItemsSource { get; set; }
Property Value
LabelAngle
The label angle.
LabelFormat
The label format.
public string? LabelFormat { get; set; }
Property Value
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.
LabelFunc
The label function.
public Func<object?, object?, object?, object?, object?, string>? LabelFunc { get; set; }
Property Value
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.
LabelVisibility
The label visibility.
LogicalOrientation
The logical orientation of the series.
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
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