Class DataPointSeries
Represents a control that contains a dynamic data series.
Inheritance
Inherited Members
Namespace: System.Windows.Controls.DataVisualization.Charting
Assembly: OpenSilver.Controls.DataVisualization.Toolkit.dll
Syntax
public abstract class DataPointSeries : Series, IControl, IFrameworkElement, IUIElement, IDependencyObject, ISeries, IRequireSeriesHost
Constructors
| Improve this Doc View SourceDataPointSeries()
Initializes a new instance of the DataPointSeries class.
Declaration
protected DataPointSeries()
Fields
| Improve this Doc View SourceActualLegendItemStyleName
The name of the ActualLegendItemStyle property.
Declaration
protected const string ActualLegendItemStyleName = "ActualLegendItemStyle"
Field Value
| Type | Description |
|---|---|
| System.String |
AnimationSequenceProperty
Identifies the AnimationSequence dependency property.
Declaration
public static readonly DependencyProperty AnimationSequenceProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
DataPointStyleName
The name of the DataPointStyle property and ResourceDictionary entry.
Declaration
protected const string DataPointStyleName = "DataPointStyle"
Field Value
| Type | Description |
|---|---|
| System.String |
DataPointStyleProperty
Identifies the DataPointStyle dependency property.
Declaration
public static readonly DependencyProperty DataPointStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsSelectionEnabledProperty
Identifies the IsSelectionEnabled dependency property.
Declaration
public static readonly DependencyProperty IsSelectionEnabledProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
LegendItemStyleName
The name of the LegendItemStyle property and ResourceDictionary entry.
Declaration
protected const string LegendItemStyleName = "LegendItemStyle"
Field Value
| Type | Description |
|---|---|
| System.String |
LegendItemStyleProperty
Identifies the LegendItemStyle dependency property.
Declaration
public static readonly DependencyProperty LegendItemStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PlotAreaName
The name of the template part with the plot area.
Declaration
protected const string PlotAreaName = "PlotArea"
Field Value
| Type | Description |
|---|---|
| System.String |
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TransitionDurationProperty
Identifies the TransitionDuration dependency property.
Declaration
public static readonly DependencyProperty TransitionDurationProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TransitionEasingFunctionProperty
Identifies the TransitionEasingFunction dependency property.
Declaration
public static readonly DependencyProperty TransitionEasingFunctionProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
| Improve this Doc View SourceActiveDataPointCount
Gets the number of active data points in the plot area.
Declaration
protected int ActiveDataPointCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
ActiveDataPoints
Gets a stream of the active data points in the plot area.
Declaration
protected virtual IEnumerable<DataPoint> ActiveDataPoints { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<DataPoint> |
AnimationSequence
Gets or sets the animation sequence to use for the DataPoints of the Series.
Declaration
public AnimationSequence AnimationSequence { get; set; }
Property Value
| Type | Description |
|---|---|
| AnimationSequence |
DataPointStyle
Gets or sets the style to use for the data points.
Declaration
public Style DataPointStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
DependentValueBinding
Gets or sets the Binding to use for identifying the dependent value.
Declaration
public Binding DependentValueBinding { get; set; }
Property Value
| Type | Description |
|---|---|
| Binding |
DependentValuePath
Gets or sets the Binding Path to use for identifying the dependent value.
Declaration
public string DependentValuePath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
IndependentValueBinding
Gets or sets the Binding to use for identifying the independent value.
Declaration
public Binding IndependentValueBinding { get; set; }
Property Value
| Type | Description |
|---|---|
| Binding |
IndependentValuePath
Gets or sets the Binding Path to use for identifying the independent value.
Declaration
public string IndependentValuePath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
IsSelectionEnabled
Gets or sets a value indicating whether elements in the series can be selected.
Declaration
public bool IsSelectionEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ItemsSource
Gets or sets a collection used to contain the data points of the Series.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.IEnumerable |
LegendItemStyle
Gets or sets the style to use for the legend items.
Declaration
public Style LegendItemStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
PlotAreaSize
Gets the size of the plot area.
Declaration
protected Size PlotAreaSize { get; }
Property Value
| Type | Description |
|---|---|
| Size |
Remarks
Use this method instead of PlotArea.ActualWidth/ActualHeight because the ActualWidth and ActualHeight properties are set after the SizeChanged handler runs.
SelectedItem
Gets or sets the selected item.
Declaration
public object SelectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object |
TransitionDuration
Gets or sets the duration of the value Transition animation.
Declaration
public TimeSpan TransitionDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
TransitionEasingFunction
Gets or sets the easing function to use when transitioning the data points.
Declaration
public IEasingFunction TransitionEasingFunction { get; set; }
Property Value
| Type | Description |
|---|---|
| IEasingFunction |
UpdatingDataPoints
Gets a value indicating whether all data points are being updated.
Declaration
protected bool UpdatingDataPoints { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceAddDataPoint(DataPoint)
Adds a data point to the plot area.
Declaration
protected virtual void AddDataPoint(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point to add to the plot area. |
AddObject(Object)
Adds an object to the series host by creating a corresponding data point for it.
Declaration
protected virtual DataPoint AddObject(object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | dataContext | The object to add to the series host. |
Returns
| Type | Description |
|---|---|
| DataPoint | The data point created for the object. |
AttachEventHandlersToDataPoint(DataPoint)
Attaches event handlers to a data point.
Declaration
protected virtual void AttachEventHandlersToDataPoint(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
CreateDataPoint()
Returns a Control suitable for the Series.
Declaration
protected abstract DataPoint CreateDataPoint()
Returns
| Type | Description |
|---|---|
| DataPoint | The DataPoint instance. |
CreateLegendItem(DataPointSeries)
Creates a legend item.
Declaration
protected virtual LegendItem CreateLegendItem(DataPointSeries owner)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPointSeries | owner | The owner of the new LegendItem. |
Returns
| Type | Description |
|---|---|
| LegendItem | A legend item for insertion in the legend items collection. |
DetachEventHandlersFromDataPoint(DataPoint)
Detaches event handlers from a data point.
Declaration
protected virtual void DetachEventHandlersFromDataPoint(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
GetDataPoint(Object)
Retrieves the data point corresponding to the object passed as the parameter.
Declaration
protected virtual DataPoint GetDataPoint(object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | dataContext | The data context used for the point. |
Returns
| Type | Description |
|---|---|
| DataPoint | The data point associated with the object. |
GetInsertionIndex(DataPoint)
Returns the index at which to insert data point in the plot area child collection.
Declaration
protected virtual int GetInsertionIndex(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point to retrieve the insertion index for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The insertion index. |
LoadDataPoints(IEnumerable, IEnumerable)
Updates data points collection with items retrieved from items source and removes the old items.
Declaration
protected void LoadDataPoints(IEnumerable newItems, IEnumerable oldItems)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.IEnumerable | newItems | The items to load. |
| System.Collections.IEnumerable | oldItems | The items to remove. |
OnAfterUpdateDataPoints()
This method that executes after data points are updated.
Declaration
protected virtual void OnAfterUpdateDataPoints()
OnApplyTemplate()
Attaches handler plot area after loading it from XAML.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnBeforeUpdateDataPoints()
This method that executes before data points are updated.
Declaration
protected virtual void OnBeforeUpdateDataPoints()
OnDataPointActualDependentValueChanged(DataPoint, IComparable, IComparable)
Handles data point actual dependent value property change.
Declaration
protected virtual void OnDataPointActualDependentValueChanged(DataPoint dataPoint, IComparable oldValue, IComparable newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
| System.IComparable | oldValue | The old value. |
| System.IComparable | newValue | The new value. |
OnDataPointActualIndependentValueChanged(DataPoint, Object, Object)
Handles data point actual independent value property change.
Declaration
protected virtual void OnDataPointActualIndependentValueChanged(DataPoint dataPoint, object oldValue, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
| System.Object | oldValue | The old value. |
| System.Object | newValue | The new value. |
OnDataPointDependentValueChanged(DataPoint, IComparable, IComparable)
Handles data point dependent value property change.
Declaration
protected virtual void OnDataPointDependentValueChanged(DataPoint dataPoint, IComparable oldValue, IComparable newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
| System.IComparable | oldValue | The old value. |
| System.IComparable | newValue | The new value. |
OnDataPointIndependentValueChanged(DataPoint, Object, Object)
Handles data point independent value property change.
Declaration
protected virtual void OnDataPointIndependentValueChanged(DataPoint dataPoint, object oldValue, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
| System.Object | oldValue | The old value. |
| System.Object | newValue | The new value. |
OnDataPointsChanged(IList<DataPoint>, IList<DataPoint>)
Called after data points have been loaded from the items source.
Declaration
protected virtual void OnDataPointsChanged(IList<DataPoint> newDataPoints, IList<DataPoint> oldDataPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IList<DataPoint> | newDataPoints | New active data points. |
| System.Collections.Generic.IList<DataPoint> | oldDataPoints | Old inactive data points. |
OnDataPointStateChanged(DataPoint, DataPointState, DataPointState)
Handles data point state property change.
Declaration
protected virtual void OnDataPointStateChanged(DataPoint dataPoint, DataPointState oldValue, DataPointState newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point. |
| DataPointState | oldValue | The old value. |
| DataPointState | newValue | The new value. |
OnDataPointStylePropertyChanged(Style, Style)
DataPointStyleProperty property changed handler.
Declaration
protected virtual void OnDataPointStylePropertyChanged(Style oldValue, Style newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Style | oldValue | Old value. |
| Style | newValue | New value. |
OnIsSelectionEnabledPropertyChanged(Boolean, Boolean)
IsSelectionEnabledProperty property changed handler.
Declaration
protected virtual void OnIsSelectionEnabledPropertyChanged(bool oldValue, bool newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | oldValue | Old value. |
| System.Boolean | newValue | New value. |
OnItemsSourceChanged(IEnumerable, IEnumerable)
Called when the ItemsSource property changes.
Declaration
protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.IEnumerable | oldValue | Old value of the ItemsSource property. |
| System.Collections.IEnumerable | newValue | New value of the ItemsSource property. |
OnItemsSourceCollectionChanged(IEnumerable, NotifyCollectionChangedEventArgs)
Method called when the ItemsSource collection changes.
Declaration
protected virtual void OnItemsSourceCollectionChanged(IEnumerable collection, NotifyCollectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.IEnumerable | collection | New value of the collection. |
| System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | Information about the change. |
OnLegendItemStylePropertyChanged(Style, Style)
Called when the value of the LegendItemStyle property changes.
Declaration
protected virtual void OnLegendItemStylePropertyChanged(Style oldValue, Style newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Style | oldValue | Old value. |
| Style | newValue | New value. |
OnPlotAreaChanged(Panel, Panel)
Removes items from the existing plot area and adds items to new plot area.
Declaration
protected virtual void OnPlotAreaChanged(Panel oldValue, Panel newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Panel | oldValue | The previous plot area. |
| Panel | newValue | The new plot area. |
OnSelectedItemPropertyChanged(Object, Object)
Called when the value of the SelectedItem property changes.
Declaration
protected virtual void OnSelectedItemPropertyChanged(object oldValue, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | oldValue | The old selected index. |
| System.Object | newValue | The new value. |
OnSeriesHostPropertyChanged(ISeriesHost, ISeriesHost)
Handles changes to the SeriesHost property.
Declaration
protected override void OnSeriesHostPropertyChanged(ISeriesHost oldValue, ISeriesHost newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ISeriesHost | oldValue | Old value. |
| ISeriesHost | newValue | New value. |
Overrides
| Improve this Doc View SourcePrepareDataPoint(DataPoint, Object)
Prepares a data point by extracting binding it to a data context object.
Declaration
protected virtual void PrepareDataPoint(DataPoint dataPoint, object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | A data point. |
| System.Object | dataContext | A data context object. |
Refresh()
Refreshes data from data source and renders the series.
Declaration
public void Refresh()
RemoveDataPoint(DataPoint)
Removes a data point from the plot area.
Declaration
protected virtual void RemoveDataPoint(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point to remove. |
RemoveObject(Object)
Removes an object from the series host by removing its corresponding data point.
Declaration
protected virtual DataPoint RemoveObject(object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | dataContext | The object to remove from the series data source. |
Returns
| Type | Description |
|---|---|
| DataPoint | The data point corresponding to the removed object. |
ShouldCreateDataPoint(Object)
Returns whether a data point should be created for the data context.
Declaration
protected virtual bool ShouldCreateDataPoint(object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | dataContext | The data context that will be used for the data point. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A value indicating whether a data point should be created for the data context. |
UpdateDataPoint(DataPoint)
Updates the visual representation of a single data point in the plot area.
Declaration
protected abstract void UpdateDataPoint(DataPoint dataPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| DataPoint | dataPoint | The data point to update. |
UpdateDataPoints(IEnumerable<DataPoint>)
Updates the visual representation of all data points in the plot area.
Declaration
protected virtual void UpdateDataPoints(IEnumerable<DataPoint> dataPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<DataPoint> | dataPoints | A sequence of data points to update. |
Events
| Improve this Doc View SourceSelectionChanged
Event raised when selection has changed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
| Type | Description |
|---|---|
| SelectionChangedEventHandler |