ChartView
MAUI candlestick chart view with touch gestures. Implements IChart for StockSharp compatibility.
Inherits: GraphicsView
Implements: IChart, IChartBuilder, IThemeableChart, IPersistable, IChartModifierSurface
Properties
public List<IAnnotation> Annotations { get; }
value = chartView.Annotations
Gets the annotations collection.
public List<ChartArea> Areas { get; }
value = chartView.Areas
Gets the chart areas collection for multi-area rendering.
public CandleDataSeries Candles { get; set; }
value = chartView.Candles
chartView.Candles = value
The candle data to display.
public ChartTheme ChartThemeModel { get; set; }
value = chartView.ChartThemeModel
chartView.ChartThemeModel = value
Gets or sets the chart theme.
public ChartDrawStyle DrawStyle { get; set; }
value = chartView.DrawStyle
chartView.DrawStyle = value
The chart draw style.
public List<ValueTuple<IReadOnlyList<decimal?>, ChartColor, string>> Indicators { get; }
value = chartView.Indicators
Indicator series to display.
public ModifierGroup Modifiers { get; }
value = chartView.Modifiers
Gets the modifier group for controlling chart interactions.
public bool ShowCrosshair { get; set; }
value = chartView.ShowCrosshair
chartView.ShowCrosshair = value
Whether to show the crosshair.
public bool ShowLegendBool { get; set; }
value = chartView.ShowLegendBool
chartView.ShowLegendBool = value
Whether to show the legend (local property).
public bool ShowVolume { get; set; }
value = chartView.ShowVolume
chartView.ShowVolume = value
Whether to show the volume subplot.
public int StartIndex { get; set; }
value = chartView.StartIndex
chartView.StartIndex = value
The starting index of visible candles.
public int VisibleCandleCount { get; set; }
value = chartView.VisibleCandleCount
chartView.VisibleCandleCount = value
The number of candles visible in the viewport.
Methods
public void AddAnnotation(IAnnotation annotation)
chartView.AddAnnotation(annotation)
Adds an annotation.
public void AddElementToArea(ChartArea area, IChartElement element)
chartView.AddElementToArea(area, element)
Internal method to add element to internal model area.
public void AddIndicator(IReadOnlyList<decimal?> values, ChartColor color, string name)
chartView.AddIndicator(values, color, name)
Adds an indicator series.
public void AddOscillator(OscillatorPane pane)
chartView.AddOscillator(pane)
Adds an oscillator sub-pane (RSI, MACD, …) below the price chart.
public void ClearAnnotations()
chartView.ClearAnnotations()
Clears all annotations.
public void ClearOscillators()
chartView.ClearOscillators()
Clears all oscillator sub-panes.
public ChartArea CreateArea(string title, double height, bool isRelativeHeight)
result = chartView.CreateArea(title, height, isRelativeHeight)
Creates a new chart area.
Ecng#Serialization#IPersistable#Load(SettingsStorage)
Ecng#Serialization#IPersistable#Save(SettingsStorage)
public ValueTuple<double, decimal> ScreenToData(ChartPoint screenPoint)
result = chartView.ScreenToData(screenPoint)
Maps a chart-local screen point to data coordinates (fractional candle index and price), or (NaN, 0) when the point is outside the price area. Used by drawing tools.
public void ScrollToEnd()
chartView.ScrollToEnd()
Scrolls to the end of the data (most recent candles).
public void ScrollToStart()
chartView.ScrollToStart()
Scrolls to the beginning of the data (oldest candles).
public void SetTheme(ChartThemeType themeType)
chartView.SetTheme(themeType)
Sets the chart theme by type.
Events
public event EventHandler<ChartRangeChangedEventArgs> RangeChanged
chartView.RangeChanged += handler
Raised when the visible range changes.