Class Chart
Represents a control that displays a Chart.
Inherited Members
Namespace: System.Windows.Controls.DataVisualization.Charting
Assembly: OpenSilver.Controls.DataVisualization.Toolkit.dll
Syntax
[TemplatePart(Name = "ChartArea", Type = typeof(EdgePanel))]
[TemplatePart(Name = "Legend", Type = typeof(Legend))]
[StyleTypedProperty(Property = "TitleStyle", StyleTargetType = typeof(Title))]
[StyleTypedProperty(Property = "LegendStyle", StyleTargetType = typeof(Legend))]
[StyleTypedProperty(Property = "ChartAreaStyle", StyleTargetType = typeof(EdgePanel))]
[StyleTypedProperty(Property = "PlotAreaStyle", StyleTargetType = typeof(Grid))]
public class Chart : Control, IControl, IFrameworkElement, IUIElement, IDependencyObject, ISeriesHost, IRequireSeriesHost, IResourceDictionaryDispenser
Constructors
| Improve this Doc View SourceChart()
Initializes a new instance of the Chart class.
Declaration
public Chart()
Fields
| Improve this Doc View SourceChartAreaStyleProperty
Identifies the ChartAreaStyle dependency property.
Declaration
public static readonly DependencyProperty ChartAreaStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
LegendStyleProperty
Identifies the LegendStyle dependency property.
Declaration
public static readonly DependencyProperty LegendStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
LegendTitleProperty
Identifies the LegendTitle dependency property.
Declaration
public static readonly DependencyProperty LegendTitleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PaletteProperty
Identifies the Palette dependency property.
Declaration
public static readonly DependencyProperty PaletteProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PlotAreaStyleProperty
Identifies the PlotAreaStyle dependency property.
Declaration
public static readonly DependencyProperty PlotAreaStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TitleProperty
Identifies the Title dependency property.
Declaration
public static readonly DependencyProperty TitleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TitleStyleProperty
Identifies the TitleStyle dependency property.
Declaration
public static readonly DependencyProperty TitleStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
| Improve this Doc View SourceActualAxes
Gets the actual axes displayed in the chart.
Declaration
public ReadOnlyCollection<IAxis> ActualAxes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ReadOnlyCollection<IAxis> |
Axes
Gets or sets a collection of Axes in the Chart.
Declaration
public Collection<IAxis> Axes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.Collection<IAxis> |
BackgroundElements
Gets the collection of background elements.
Declaration
protected ObservableCollection<UIElement> BackgroundElements { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<UIElement> |
ChartAreaStyle
Gets or sets the Style of the ISeriesHost's ChartArea.
Declaration
public Style ChartAreaStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
ForegroundElements
Gets the collection of foreground elements.
Declaration
protected ObservableCollection<UIElement> ForegroundElements { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<UIElement> |
LegendItems
Gets the collection of legend items.
Declaration
public Collection<object> LegendItems { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.Collection<System.Object> |
LegendStyle
Gets or sets the Style of the ISeriesHost's Legend.
Declaration
public Style LegendStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
LegendTitle
Gets or sets the Title content of the Legend.
Declaration
public object LegendTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object |
Palette
Gets or sets a palette of ResourceDictionaries used by the children of the Chart.
Declaration
public Collection<ResourceDictionary> Palette { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.Collection<ResourceDictionary> |
PlotAreaStyle
Gets or sets the Style of the ISeriesHost's PlotArea.
Declaration
public Style PlotAreaStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
Series
Gets or sets the collection of Series displayed by the Chart.
Declaration
public Collection<ISeries> Series { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.Collection<ISeries> |
SeriesHost
Gets or sets the Series host of the chart.
Declaration
protected ISeriesHost SeriesHost { get; set; }
Property Value
| Type | Description |
|---|---|
| ISeriesHost |
Remarks
This will always return null.
Title
Gets or sets the title displayed for the Chart.
Declaration
public object Title { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object |
TitleStyle
Gets or sets the Style of the ISeriesHost's Title.
Declaration
public Style TitleStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
Methods
| Improve this Doc View SourceGetResourceDictionariesWhere(Func<ResourceDictionary, Boolean>)
Returns a rotating enumerator of ResourceDictionary objects that coordinates with the dispenser object to ensure that no two enumerators are on the same item. If the dispenser is reset or its collection is changed then the enumerators are also reset.
Declaration
public IEnumerator<ResourceDictionary> GetResourceDictionariesWhere(Func<ResourceDictionary, bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<ResourceDictionary, System.Boolean> | predicate | A predicate that returns a value indicating whether to return an item. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<ResourceDictionary> | An enumerator of ResourceDictionaries. |
OnApplyTemplate()
Builds the visual tree for the Chart control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
Events
| Improve this Doc View SourceResourceDictionariesChanged
Event that is invoked when the ResourceDictionaryDispenser's collection has changed.
Declaration
public event EventHandler ResourceDictionariesChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
Explicit Interface Implementations
| Improve this Doc View SourceIRequireSeriesHost.SeriesHost
Gets or sets the Series host of the chart.
Declaration
ISeriesHost IRequireSeriesHost.SeriesHost { get; set; }
Returns
| Type | Description |
|---|---|
| ISeriesHost |
Remarks
This will always return null.
ISeriesHost.Axes
Gets the axes collection of the chart.
Declaration
ObservableCollection<IAxis> ISeriesHost.Axes { get; }
Returns
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<IAxis> |
ISeriesHost.BackgroundElements
Gets the collection of background elements.
Declaration
ObservableCollection<UIElement> ISeriesHost.BackgroundElements { get; }
Returns
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<UIElement> |
ISeriesHost.ForegroundElements
Gets the collection of foreground elements.
Declaration
ObservableCollection<UIElement> ISeriesHost.ForegroundElements { get; }
Returns
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<UIElement> |
ISeriesHost.Series
Gets the Series collection of the chart.
Declaration
ObservableCollection<ISeries> ISeriesHost.Series { get; }
Returns
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<ISeries> |