CartesianChart Class
Definition
A chart that uses the Cartesian coordinate system to plot data points.
public class CartesianChart
Constructors
| Name | Description |
|---|---|
| CartesianChart | Initializes a new instance of the Avalonia.Controls.Charts.CartesianChart class. |
CartesianChart Constructor
Initializes a new instance of the Avalonia.Controls.Charts.CartesianChart class.
public CartesianChart()
Methods
| Name | Description |
|---|---|
| AddHandler (2 overloads) | Adds a handler for the specified routed event. Inherited from Interactive. |
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| ApplyTemplate | Creates the visual children of the control, if necessary Inherited from TemplatedControl. |
| Arrange | Arranges the control and its children. Inherited from Layoutable. |
| BeginInit | Inherited from StyledElement. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CalculateMarkerPadding | Calculates the maximum extra padding required so series markers, labels, and selection adornments are not clipped. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| EndInit | Inherited from StyledElement. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| ExportAsync (3 overloads) | Inherited from ChartBase. |
| Focus | Focuses the control. Inherited from InputElement. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetFlowDirection | Gets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetIsHoldingEnabled | Inherited from InputElement. |
| GetIsHoldWithMouseEnabled | Inherited from InputElement. |
| GetIsTemplateFocusTarget | Gets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| GetLegendItems | Gets the legend items for this chart based on its series. Inherited from ChartBase. |
| GetSeriesBrush | Gets the brush for a series at the specified index from the palette. Inherited from ChartBase. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| GoBackZoom | Restores the previous zoom state from the zoom history stack. |
| InvalidateArrange | Invalidates the arrangement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateMeasure | Invalidates the measurement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateVisual | Invalidates the visual and queues a repaint. Inherited from Visual. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| Measure | Carries out a measure of the control. Inherited from Layoutable. |
| RaiseEvent | Raises a routed event. Inherited from Interactive. |
| RemoveHandler (2 overloads) | Removes a handler for the specified routed event. Inherited from Interactive. |
| Render | Clears stale hit regions then delegates to the Avalonia render pipeline. All derived chart overrides call base.Render(context), so this runs before every frame. |
| ReplayAnimation | Replays the entry animation. Inherited from ChartBase. |
| RequestUpdate | Requests a visual update. If updates are suspended, the redraw is deferred until Avalonia.Controls.Charts.CartesianChart.ResumeUpdates is called. |
| ResetZoom | Clears the current viewport overrides and returns the chart to its full data range. |
| ResumeUpdates | Resumes visual updates after a Avalonia.Controls.Charts.CartesianChart.SuspendUpdates call. If updates were pending, the chart will be redrawn. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetFlowDirection | Sets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| SetIsHoldingEnabled | Inherited from InputElement. |
| SetIsHoldWithMouseEnabled | Inherited from InputElement. |
| SetIsTemplateFocusTarget | Sets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| SuspendUpdates | Suspends visual updates until Avalonia.Controls.Charts.CartesianChart.ResumeUpdates is called. Use for batch data changes to avoid redundant redraws. |
| TryGetResource | Inherited from StyledElement. |
| UpdateLayout | Executes a layout pass. Inherited from Layoutable. |
| ValueToNormalizedPosition | Converts a data value to a normalized position (0 to 1) based on the axis type. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
| ZoomAt | Zooms the chart centered at the specified pivot point. |
| ZoomTo (2 overloads) | Sets the visible range for a single axis. |
CalculateMarkerPadding Method
Calculates the maximum extra padding required so series markers, labels, and selection adornments are not clipped.
public double CalculateMarkerPadding()
Returns
double
The padding, in device-independent pixels, that should be reserved around the plot area.
GoBackZoom Method
Restores the previous zoom state from the zoom history stack.
public bool GoBackZoom()
Returns
bool
True if a previous zoom state was restored; otherwise, false.
Render Method
Clears stale hit regions then delegates to the Avalonia render pipeline. All derived chart overrides call base.Render(context), so this runs before every frame.
public void Render(Avalonia.Media.DrawingContext context)
Parameters
context Avalonia.Media.DrawingContext
The drawing context.
RequestUpdate Method
Requests a visual update. If updates are suspended, the redraw is deferred until Avalonia.Controls.Charts.CartesianChart.ResumeUpdates is called.
public void RequestUpdate()
ResetZoom Method
Clears the current viewport overrides and returns the chart to its full data range.
public void ResetZoom()
ResumeUpdates Method
Resumes visual updates after a Avalonia.Controls.Charts.CartesianChart.SuspendUpdates call. If updates were pending, the chart will be redrawn.
public void ResumeUpdates()
SuspendUpdates Method
Suspends visual updates until Avalonia.Controls.Charts.CartesianChart.ResumeUpdates is called. Use for batch data changes to avoid redundant redraws.
public void SuspendUpdates()
ValueToNormalizedPosition Method
Converts a data value to a normalized position (0 to 1) based on the axis type.
public double ValueToNormalizedPosition(double value, double axisMin, double axisMax)
Parameters
value double
axisMin double
axisMax double
Returns
double
ZoomAt Method
Zooms the chart centered at the specified pivot point.
public void ZoomAt(double zoomFactor, double pivotX, double pivotY)
Parameters
zoomFactor double
The factor to multiply current range by (e.g., 0.9 for zoom in, 1.1 for zoom out).
pivotX double
The X coordinate of the pivot point (relative to the chart control).
pivotY double
The Y coordinate of the pivot point (relative to the chart control).
ZoomTo overloads
ZoomTo Method
Sets the visible range for a single axis.
public void ZoomTo(double newMin, double newMax, Avalonia.Controls.Charts.ChartAxis axis)