Skip to main content

Class ChartView

Namespace: VelloSharp.Charting.Avalonia
Assembly: VelloSharp.Charting.Avalonia.dll

Avalonia control that renders real-time charts using the Vello engine.

public sealed class ChartView : ContentControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue

Inheritance

object ← AvaloniaObject ← Animatable ← StyledElement ← Visual ← Layoutable ← Interactive ← InputElement ← Control ← TemplatedControl ← ContentControl ← ChartView

Implements

INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue

Inherited Members

ContentControl.ContentProperty, ContentControl.ContentTemplateProperty, ContentControl.HorizontalContentAlignmentProperty, ContentControl.VerticalContentAlignmentProperty, ContentControl.Content, ContentControl.ContentTemplate, ContentControl.Presenter, ContentControl.HorizontalContentAlignment, ContentControl.VerticalContentAlignment, TemplatedControl.BackgroundProperty, TemplatedControl.BackgroundSizingProperty, TemplatedControl.BorderBrushProperty, TemplatedControl.BorderThicknessProperty, TemplatedControl.CornerRadiusProperty, TemplatedControl.FontFamilyProperty, TemplatedControl.FontFeaturesProperty, TemplatedControl.FontSizeProperty, TemplatedControl.FontStyleProperty, TemplatedControl.FontWeightProperty, TemplatedControl.FontStretchProperty, TemplatedControl.ForegroundProperty, TemplatedControl.PaddingProperty, TemplatedControl.TemplateProperty, TemplatedControl.IsTemplateFocusTargetProperty, TemplatedControl.TemplateAppliedEvent, TemplatedControl.GetIsTemplateFocusTarget(Control), TemplatedControl.SetIsTemplateFocusTarget(Control, bool), TemplatedControl.ApplyTemplate(), TemplatedControl.Background, TemplatedControl.BackgroundSizing, TemplatedControl.BorderBrush, TemplatedControl.BorderThickness, TemplatedControl.CornerRadius, TemplatedControl.FontFamily, TemplatedControl.FontFeatures, TemplatedControl.FontSize, TemplatedControl.FontStyle, TemplatedControl.FontWeight, TemplatedControl.FontStretch, TemplatedControl.Foreground, TemplatedControl.Padding, TemplatedControl.Template, TemplatedControl.TemplateApplied, Control.FocusAdornerProperty, Control.TagProperty, Control.ContextMenuProperty, Control.ContextFlyoutProperty, Control.RequestBringIntoViewEvent, Control.ContextRequestedEvent, Control.LoadedEvent, Control.UnloadedEvent, Control.SizeChangedEvent, Control.FocusAdorner, Control.DataTemplates, Control.ContextMenu, Control.ContextFlyout, Control.IsLoaded, Control.Tag, Control.ContextRequested, Control.Loaded, Control.Unloaded, Control.SizeChanged, InputElement.FocusableProperty, InputElement.IsEnabledProperty, InputElement.IsEffectivelyEnabledProperty, InputElement.CursorProperty, InputElement.IsKeyboardFocusWithinProperty, InputElement.IsFocusedProperty, InputElement.IsHitTestVisibleProperty, InputElement.IsPointerOverProperty, InputElement.IsTabStopProperty, InputElement.GotFocusEvent, InputElement.LostFocusEvent, InputElement.KeyDownEvent, InputElement.KeyUpEvent, InputElement.TabIndexProperty, InputElement.TextInputEvent, InputElement.TextInputMethodClientRequestedEvent, InputElement.PointerEnteredEvent, InputElement.PointerExitedEvent, InputElement.PointerMovedEvent, InputElement.PointerPressedEvent, InputElement.PointerReleasedEvent, InputElement.PointerCaptureLostEvent, InputElement.PointerWheelChangedEvent, InputElement.TappedEvent, InputElement.HoldingEvent, InputElement.DoubleTappedEvent, InputElement.Focus(NavigationMethod, KeyModifiers), InputElement.Focusable, InputElement.IsEnabled, InputElement.Cursor, InputElement.IsKeyboardFocusWithin, InputElement.IsFocused, InputElement.IsHitTestVisible, InputElement.IsPointerOver, InputElement.IsTabStop, InputElement.IsEffectivelyEnabled, InputElement.TabIndex, InputElement.KeyBindings, InputElement.GestureRecognizers, InputElement.GotFocus, InputElement.LostFocus, InputElement.KeyDown, InputElement.KeyUp, InputElement.TextInput, InputElement.TextInputMethodClientRequested, InputElement.PointerEntered, InputElement.PointerExited, InputElement.PointerMoved, InputElement.PointerPressed, InputElement.PointerReleased, InputElement.PointerCaptureLost, InputElement.PointerWheelChanged, InputElement.Tapped, InputElement.Holding, InputElement.DoubleTapped, Interactive.AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool), Interactive.AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>?, RoutingStrategies, bool), Interactive.RemoveHandler(RoutedEvent, Delegate), Interactive.RemoveHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>?), Interactive.RaiseEvent(RoutedEventArgs), Layoutable.DesiredSizeProperty, Layoutable.WidthProperty, Layoutable.HeightProperty, Layoutable.MinWidthProperty, Layoutable.MaxWidthProperty, Layoutable.MinHeightProperty, Layoutable.MaxHeightProperty, Layoutable.MarginProperty, Layoutable.HorizontalAlignmentProperty, Layoutable.VerticalAlignmentProperty, Layoutable.UseLayoutRoundingProperty, Layoutable.UpdateLayout(), Layoutable.ApplyTemplate(), Layoutable.Measure(Size), Layoutable.Arrange(Rect), Layoutable.InvalidateMeasure(), Layoutable.InvalidateArrange(), Layoutable.Width, Layoutable.Height, Layoutable.MinWidth, Layoutable.MaxWidth, Layoutable.MinHeight, Layoutable.MaxHeight, Layoutable.Margin, Layoutable.HorizontalAlignment, Layoutable.VerticalAlignment, Layoutable.DesiredSize, Layoutable.IsMeasureValid, Layoutable.IsArrangeValid, Layoutable.UseLayoutRounding, Layoutable.EffectiveViewportChanged, Layoutable.LayoutUpdated, Visual.BoundsProperty, Visual.ClipToBoundsProperty, Visual.ClipProperty, Visual.IsVisibleProperty, Visual.OpacityProperty, Visual.OpacityMaskProperty, Visual.EffectProperty, Visual.HasMirrorTransformProperty, Visual.RenderTransformProperty, Visual.RenderTransformOriginProperty, Visual.FlowDirectionProperty, Visual.VisualParentProperty, Visual.ZIndexProperty, Visual.GetFlowDirection(Visual), Visual.SetFlowDirection(Visual, FlowDirection), Visual.InvalidateVisual(), Visual.Render(DrawingContext), Visual.Bounds, Visual.ClipToBounds, Visual.Clip, Visual.IsEffectivelyVisible, Visual.IsVisible, Visual.Opacity, Visual.OpacityMask, Visual.Effect, Visual.HasMirrorTransform, Visual.RenderTransform, Visual.RenderTransformOrigin, Visual.FlowDirection, Visual.ZIndex, Visual.AttachedToVisualTree, Visual.DetachedFromVisualTree, StyledElement.DataContextProperty, StyledElement.NameProperty, StyledElement.ParentProperty, StyledElement.TemplatedParentProperty, StyledElement.ThemeProperty, StyledElement.BeginInit(), StyledElement.EndInit(), StyledElement.ApplyStyling(), StyledElement.TryGetResource(object, ThemeVariant?, out object?), StyledElement.Name, StyledElement.Classes, StyledElement.DataContext, StyledElement.IsInitialized, StyledElement.Styles, StyledElement.StyleKey, StyledElement.Resources, StyledElement.TemplatedParent, StyledElement.Theme, StyledElement.Parent, StyledElement.ActualThemeVariant, StyledElement.AttachedToLogicalTree, StyledElement.DetachedFromLogicalTree, StyledElement.DataContextChanged, StyledElement.Initialized, StyledElement.ResourcesChanged, StyledElement.ActualThemeVariantChanged, Animatable.TransitionsProperty, Animatable.Transitions, AvaloniaObject.CheckAccess(), AvaloniaObject.VerifyAccess(), AvaloniaObject.ClearValue(AvaloniaProperty), AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>), AvaloniaObject.ClearValue<T>(StyledProperty<T>), AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>), AvaloniaObject.Equals(object?), AvaloniaObject.GetHashCode(), AvaloniaObject.GetValue(AvaloniaProperty), AvaloniaObject.GetValue<T>(StyledProperty<T>), AvaloniaObject.GetValue<T>(DirectPropertyBase<T>), AvaloniaObject.GetBaseValue<T>(StyledProperty<T>), AvaloniaObject.IsAnimating(AvaloniaProperty), AvaloniaObject.IsSet(AvaloniaProperty), AvaloniaObject.SetValue(AvaloniaProperty, object?, BindingPriority), AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority), AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T), AvaloniaObject.SetCurrentValue(AvaloniaProperty, object?), AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T), AvaloniaObject.Bind(AvaloniaProperty, IBinding), AvaloniaObject.Bind(AvaloniaProperty, IObservable<object?>, BindingPriority), AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object?>, BindingPriority), AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority), AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority), AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object?>), AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>), AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>), AvaloniaObject.CoerceValue(AvaloniaProperty), AvaloniaObject.this[AvaloniaProperty], AvaloniaObject.this[IndexerDescriptor], AvaloniaObject.PropertyChanged, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

ChartView()

public ChartView()

Properties

Annotations

Gets or sets annotations rendered over the plot area.

public IReadOnlyList<ChartAnnotation>? Annotations { get; set; }

Property Value

IReadOnlyList<ChartAnnotation>?

ChartEngine

Gets or sets the chart engine that produces frames for this view.

public ChartEngine ChartEngine { get; set; }

Property Value

ChartEngine

Composition

Gets or sets the composition blueprint describing pane layout.

public ChartComposition? Composition { get; set; }

Property Value

ChartComposition?

Input

Gets the shared input control handling pointer and keyboard events for chart interactions.

public InputControl Input { get; }

Property Value

InputControl

IsLoopEnabled

Enables or disables the internal animation loop on the surface view. When disabled the chart relies on the engine scheduler to request frames.

public bool IsLoopEnabled { get; set; }

Property Value

bool

Legend

Gets or sets an optional legend definition rendered on top of the chart. When null, a default legend is built from the frame metadata.

public LegendDefinition? Legend { get; set; }

Property Value

LegendDefinition?

OwnsEngine

Gets or sets whether the view disposes the attached .

public bool OwnsEngine { get; set; }

Property Value

bool

RenderParameters

Gets or sets render parameters (dimension, background) forwarded to the underlying surface view.

public RenderParams RenderParameters { get; set; }

Property Value

RenderParams

RendererOptions

Gets or sets the renderer options applied to the GPU surface view.

public RendererOptions RendererOptions { get; set; }

Property Value

RendererOptions

Theme

Gets or sets the theme used for axis, grid, legend, and annotations.

public ChartTheme Theme { get; set; }

Property Value

ChartTheme

Methods

OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)

Called when the styled element is added to a rooted logical tree.

protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)

Parameters

e LogicalTreeAttachmentEventArgs

The event args.

OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is added to a rooted visual tree.

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)

Called when the styled element is removed from a rooted logical tree.

protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)

Parameters

e LogicalTreeAttachmentEventArgs

The event args.

OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is removed from a rooted visual tree.

protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

PublishSamples(ReadOnlySpan<ChartSamplePoint>)

Enqueues sample data for rendering.

public void PublishSamples(ReadOnlySpan<ChartSamplePoint> samples)

Parameters

samples ReadOnlySpan<ChartSamplePoint>

RequestRender()

Triggers a new render pass.

public void RequestRender()