XYChart Class
Represents a chart control that uses an X/Y coordinate system.
[StyleTypedProperty(Property = "AxisBaselineStyle", StyleTargetType = typeof(Shape))]
[StyleTypedProperty(Property = "LegendStyle", StyleTargetType = typeof(ItemsControl))]
[TemplatePart(Name = "PART_ChartPanel", Type = typeof(ChartPanel))]
public class XYChart : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
Constructors
XYChart()
Initializes an instance of the class.
public XYChart()
Properties
AxisBaselineStyle
GridLineMajorBrush
The grid line major brush.
GridLineMajorVisibility
The grid line major visibility.
GridLineMinorBrush
The grid line minor brush.
GridLineMinorVisibility
The grid line minor visibility.
GridStripeAlternatingBrush
The grid stripe alternating brush.
GridStripeBrush
The grid stripe brush.
GridStripeVisibility
The grid stripe visibility.
IsAxisBaselineVisible
Indicates whether a line is rendered at the baseline value.
IsLegendVisible
Indicates whether the legend is visible.
LabelCollisionMode
The label collision mode.
LegendHorizontalPosition
The horizontal position of the legend. Inside positions will place the legend inside the chart itself. Outside positions will place the legend relative to the entire control, including axes and titles.
public LegendHorizontalPosition LegendHorizontalPosition { get; set; }
Property Value
LegendKeys
The collection of legend keys displayed in the legend.
public ObservableCollection<LegendKey> LegendKeys { get; }
Property Value
LegendStyle
The Style applied to the legend. The Style must have a TargetType of ItemsControl.
LegendVerticalPosition
The vertical position of the legend. Inside positions will place the legend inside the chart itself. Outside positions will place the legend relative to the entire control, including axes and titles.
public LegendVerticalPosition LegendVerticalPosition { get; set; }
Property Value
PaddingPercentage
The percentage of the chart size used for padding. Valid values are 0.0d (0%) to 1.0d (100%).
Series
The collection of series displayed by this chart.
SeriesStyleSelector
Custom style-selection logic for a style that can be applied to each element in the associated series.
public ISeriesStyleSelector SeriesStyleSelector { get; set; }
Property Value
- ISeriesStyleSelector:
The default value is
null.
XAxes
The collection of X axes displayed by this chart.
YAxes
The collection of Y axes displayed by this chart.
Methods
ArrangeOverride(Size)
Called to arrange and size the content of a Control object.
protected override Size ArrangeOverride(Size finalSize)
| Parameter | Type | Description |
|---|---|---|
| finalSize | Size |
Returns
- Size:
The size of the control.
MeasureOverride(Size)
Called to remeasure a control.
protected override Size MeasureOverride(Size availableSize)
| Parameter | Type | Description |
|---|---|---|
| availableSize | Size |
Returns
- Size:
The size of the control, up to the maximum specified by
constraint.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnMouseLeave(MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseLeave attached event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeave(MouseEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The MouseEventArgs that contains the event data. |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnMouseMove(MouseEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The MouseEventArgs that contains the event data. |
Refresh()
Updates the chart based on the current state.
public void Refresh()
Fields
AxisBaselineStyleProperty
Defines the AxisBaselineStyle property.
public static readonly DependencyProperty AxisBaselineStyleProperty
GridLineMajorBrushProperty
Defines the GridLineMajorBrush property.
public static readonly DependencyProperty GridLineMajorBrushProperty
GridLineMajorVisibilityProperty
Defines the GridLineMajorVisibility property.
public static readonly DependencyProperty GridLineMajorVisibilityProperty
GridLineMinorBrushProperty
Defines the GridLineMinorBrush property.
public static readonly DependencyProperty GridLineMinorBrushProperty
GridLineMinorVisibilityProperty
Defines the GridLineMinorVisibility property.
public static readonly DependencyProperty GridLineMinorVisibilityProperty
GridStripeAlternatingBrushProperty
Defines the GridStripeAlternatingBrush property.
public static readonly DependencyProperty GridStripeAlternatingBrushProperty
GridStripeBrushProperty
Defines the GridStripeBrush property.
public static readonly DependencyProperty GridStripeBrushProperty
GridStripeVisibilityProperty
Defines the GridStripeVisibility property.
public static readonly DependencyProperty GridStripeVisibilityProperty
IsAxisBaselineVisibleProperty
Defines the IsAxisBaselineVisible property.
public static readonly DependencyProperty IsAxisBaselineVisibleProperty
IsLegendVisibleProperty
Defines the IsLegendVisible property.
public static readonly DependencyProperty IsLegendVisibleProperty
LabelCollisionModeProperty
Defines the LabelCollisionMode property.
public static readonly DependencyProperty LabelCollisionModeProperty
LegendHorizontalPositionProperty
Defines the LegendHorizontalPosition property.
public static readonly DependencyProperty LegendHorizontalPositionProperty
LegendStyleProperty
Defines the LegendStyle property.
public static readonly DependencyProperty LegendStyleProperty
LegendVerticalPositionProperty
Defines the LegendVerticalPosition property.
public static readonly DependencyProperty LegendVerticalPositionProperty
PaddingPercentageProperty
Defines the PaddingPercentage property.
public static readonly DependencyProperty PaddingPercentageProperty
SeriesStyleSelectorProperty
Defines the SeriesStyleSelector property.
public static readonly DependencyProperty SeriesStyleSelectorProperty