XYAxisBase Class
Represents the base functionality of a chart axis.
[StyleTypedProperty(Property = "LabelStyle", StyleTargetType = typeof(TextBlock))]
[StyleTypedProperty(Property = "TitleStyle", StyleTargetType = typeof(ContentControl))]
[StyleTypedProperty(Property = "TickMajorStyle", StyleTargetType = typeof(Path))]
[StyleTypedProperty(Property = "TickMinorStyle", StyleTargetType = typeof(Path))]
[TemplatePart(Name = "PART_LogicalGrid", Type = typeof(Grid))]
public abstract class XYAxisBase : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
Properties
AreLabelsVisible
Whether or not axis labels are visible.
AreMajorTicksVisible
Whether or not major ticks are visible.
AreMinorTicksVisible
Whether or not minor ticks are visible.
AxisType
The type of data on the axis.
BarGroupSpacing
The bar group spacing.
BarSpacing
The amount of spacing applied to either side of the individual bar shapes.
LabelAngle
The angle at which to draw the axis labels.
LabelFormat
The string format used when presenting a label on an axis tick.
public string LabelFormat { get; set; }
Property Value
Remarks
The format string will be passed the following parameters:
- {0} - The value of the axis tick, or null when the axis is slotted, such as on a bar chart.
- {1} - The starting value of the current slot when the axis is slotted, such as on a bar chart. Otherwise, null.
- {2} - The ending value of the current slot when the axis is slotted, such as on a bar chart. Otherwise, null.
LabelStyle
Position
The axis position.
Ranges
The collection of ranges displayed by this chart.
TickMajorStyle
TickMinorStyle
Title
The axis title.
TitleStyle
The style to apply to the axis title. TargetType of the Style must be a ContentPresenter.
UseDisplayOptimizations
Whether data point values are rounded to better appear on display pixels.
public bool UseDisplayOptimizations { get; set; }
Property Value
- bool:
The default value is
true.
Remarks
This property is usually good to leave as its default value of true because it will ensure that lines render with minimal anti-aliasing.
It accomplishes this by slightly rounding data point values as needed.
However, if precise data point locations are required, such as when rendering a smooth curved line graph, set this to false to remove line jaggedness.
Methods
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnPropertyChanged(DependencyObject, DependencyPropertyChangedEventArgs)
Called when the value of a property has changed that requires the control to be refreshed.
protected static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
| Parameter | Type | Description |
|---|---|---|
| sender | DependencyObject | The control whose property changed. |
| args | DependencyPropertyChangedEventArgs | The event data. |
Events
Refreshed
Occurs when XYAxisBase is refreshed.
Fields
AreLabelsVisibleProperty
Defines the AreLabelsVisible property.
public static readonly DependencyProperty AreLabelsVisibleProperty
AreMajorTicksVisibleProperty
Defines the AreMajorTicksVisible property.
public static readonly DependencyProperty AreMajorTicksVisibleProperty
AreMinorTicksVisibleProperty
Defines the AreMinorTicksVisible property.
public static readonly DependencyProperty AreMinorTicksVisibleProperty
BarGroupSpacingProperty
Defines the BarGroupSpacing property.
public static readonly DependencyProperty BarGroupSpacingProperty
BarSpacingProperty
Defines the BarSpacing property.
public static readonly DependencyProperty BarSpacingProperty
LabelAngleProperty
Defines the LabelAngle property.
public static readonly DependencyProperty LabelAngleProperty
LabelFormatProperty
Defines the LabelFormat property.
public static readonly DependencyProperty LabelFormatProperty
LabelStyleProperty
Defines the LabelStyle property.
public static readonly DependencyProperty LabelStyleProperty
PositionProperty
Defines the Position property.
public static readonly DependencyProperty PositionProperty
TickMajorStyleProperty
Defines the TickMajorStyle property.
public static readonly DependencyProperty TickMajorStyleProperty
TickMinorStyleProperty
Defines the TickMinorStyle property.
public static readonly DependencyProperty TickMinorStyleProperty
TitleProperty
Defines the Title property.
public static readonly DependencyProperty TitleProperty
TitleStyleProperty
Defines the TitleStyle property.
public static readonly DependencyProperty TitleStyleProperty
UseDisplayOptimizationsProperty
Defines the UseDisplayOptimizations property.
public static readonly DependencyProperty UseDisplayOptimizationsProperty