ChartView
ConsoleMonster.Interactive
A chart you can explore inside an app. A crosshair follows ←/→ or a click and the row above the plot reads every shown series at that point (the app footer repeats it for screen readers). A number key or a click on a legend entry hides or shows a series; + and - or the wheel zoom along X, Shift+←/→ or a drag pans, and Home shows everything again. The value is the index of the point under the crosshair. Give a DataGrid the same ChartView.LinkKey to link the two through app state: selecting a row moves the crosshair to that point and moving the crosshair selects the row. Drawing the chart outside an app is unchanged.
Inheritance
- InputControl
- ChartView
Usage
Explore 53 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 27
- Extension method ChartView.AddBinding
- Extension method ChartView.AddBindings
- Extension method ChartView.AddPointLabel
- Extension method ChartView.AddPointLabels
- Extension method ChartView.Disabled
- Extension method ChartView.Height
- Extension method ChartView.Label
- Extension method ChartView.LinkKey
- Extension method ChartView.Pan
- Extension method ChartView.SelectedIndex
- Extension method ChartView.TabIndex
- Extension method ChartView.ValidationMessage
- Extension method ChartView.ZoomLevel
- Method ChartViewInputOptions.Build
- Method InteractiveFluent.AddBinding
- Method InteractiveFluent.AddBindings
- Method InteractiveFluent.AddPointLabel
- Method InteractiveFluent.AddPointLabels
- Method InteractiveFluent.Disabled
- Method InteractiveFluent.Height
- Method InteractiveFluent.Label
- Method InteractiveFluent.LinkKey
- Method InteractiveFluent.Pan
- Method InteractiveFluent.SelectedIndex
- Method InteractiveFluent.TabIndex
- Method InteractiveFluent.ValidationMessage
- Method InteractiveFluent.ZoomLevel
Accepted by parameters 26
- Extension method ChartView.AddBinding
- Extension method ChartView.AddBindings
- Extension method ChartView.AddPointLabel
- Extension method ChartView.AddPointLabels
- Extension method ChartView.Disabled
- Extension method ChartView.Height
- Extension method ChartView.Label
- Extension method ChartView.LinkKey
- Extension method ChartView.Pan
- Extension method ChartView.SelectedIndex
- Extension method ChartView.TabIndex
- Extension method ChartView.ValidationMessage
- Extension method ChartView.ZoomLevel
- Method InteractiveFluent.AddBinding
- Method InteractiveFluent.AddBindings
- Method InteractiveFluent.AddPointLabel
- Method InteractiveFluent.AddPointLabels
- Method InteractiveFluent.Disabled
- Method InteractiveFluent.Height
- Method InteractiveFluent.Label
- Method InteractiveFluent.LinkKey
- Method InteractiveFluent.Pan
- Method InteractiveFluent.SelectedIndex
- Method InteractiveFluent.TabIndex
- Method InteractiveFluent.ValidationMessage
- Method InteractiveFluent.ZoomLevel
Constructors
public ChartView(string key, ChartPlot chart) #Explores a chart: a LineChart (converted implicitly), or any other ChartPlot.
Parameters
- key string
- The application-state key holding the index of the point under the crosshair.
- chart ConsoleMonster.Interactive.ChartPlot
- The chart; a LineChart keeps drawing the same outside an app.
Methods
Inherited Methods
public bool HandleInput(InputEvent input, RenderContext context) #Parameters
- input InputEvent
- context RenderContext
Returns
boolpublic Size Measure(Constraints constraints, RenderContext context) #Parameters
- constraints Constraints
- context RenderContext
Returns
Sizepublic void Render(Region region, RenderContext context) #Parameters
- region Region
- context RenderContext
Properties
public int Height { get; set; } #Rows for the readout and the plot, legend included (default 10).
public IList<string> PointLabels { get; } #Labels for the points along X (a time, a build), read out with their values; missing labels show the point number.
public string? LinkKey { get; set; } #The app-state key shared with linked controls such as a DataGrid (see ILinkedSelection): the point under the crosshair.
public int SelectedIndex { get; set; } #The index of the point under the crosshair, or -1 before there is data. Assignments notify like a click.
public int ZoomLevel { get; set; } #The zoom level: 0 shows the whole X range and each level shows a narrower window.
public double Pan { get; set; } #Where the zoomed window sits: 0 at the start of the X range, 1 at its end.
Inherited Properties
Inherited Events
public event EventHandler<AppValueChangedEventArgs>? Changed #Extension Methods
public static ChartView AddBinding(ChartView chartView, KeyBinding item) #Adds an item to InputControl.Bindings: Keys that apply while this control has focus. They reach the control before its own keys (so Enter can open the selected row) and feed the app footer.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- item ConsoleMonster.Interactive.KeyBinding
- The item.
public static ChartView AddBindings(ChartView chartView, params KeyBinding[] items) #Adds items to InputControl.Bindings: Keys that apply while this control has focus. They reach the control before its own keys (so Enter can open the selected row) and feed the app footer.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- items ConsoleMonster.Interactive.KeyBinding[]
- The items, in order.
public static ChartView AddBindings(ChartView chartView, IEnumerable<KeyBinding> items) #Adds items to InputControl.Bindings: Keys that apply while this control has focus. They reach the control before its own keys (so Enter can open the selected row) and feed the app footer.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- items System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.KeyBinding>
- The items, in order.
public static ChartView AddPointLabel(ChartView chartView, string item) #Adds an item to ChartView.PointLabels: Labels for the points along X (a time, a build), read out with their values; missing labels show the point number.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- item string
- The item.
public static ChartView AddPointLabels(ChartView chartView, params string[] items) #Adds items to ChartView.PointLabels: Labels for the points along X (a time, a build), read out with their values; missing labels show the point number.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- items string[]
- The items, in order.
public static ChartView AddPointLabels(ChartView chartView, IEnumerable<string> items) #Adds items to ChartView.PointLabels: Labels for the points along X (a time, a build), read out with their values; missing labels show the point number.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static ChartView Disabled(ChartView chartView, bool value) #Sets InputControl.Disabled: Whether this control is excluded from input and focus traversal.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
chartView.Disabled = value; chartView.Disabled(value);public static ChartView Disabled(ChartView chartView) #Sets InputControl.Disabled to true.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance to configure.
public static ChartView Height(ChartView chartView, int value) #Sets ChartView.Height: Rows for the readout and the plot, legend included (default 10).
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
chartView.Height = value; chartView.Height(value);public static ChartView Label(ChartView chartView, string? value) #Sets InputControl.Label: The visible label, or null to use the name.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
chartView.Label = value; chartView.Label(value);public static ChartView LinkKey(ChartView chartView, string? value) #Sets ChartView.LinkKey: The app-state key shared with linked controls such as a DataGrid (see ILinkedSelection): the point under the crosshair.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
chartView.LinkKey = value; chartView.LinkKey(value);public static ChartView Pan(ChartView chartView, double value) #Sets ChartView.Pan: Where the zoomed window sits: 0 at the start of the X range, 1 at its end.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value double
- The value.
Examples
// C# initializer or property // C# fluent
chartView.Pan = value; chartView.Pan(value);public static ChartView SelectedIndex(ChartView chartView, int value) #Sets ChartView.SelectedIndex: The index of the point under the crosshair, or -1 before there is data. Assignments notify like a click.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
chartView.SelectedIndex = value; chartView.SelectedIndex(value);public static ChartView TabIndex(ChartView chartView, int value) #Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
chartView.TabIndex = value; chartView.TabIndex(value);public static ChartView ValidationMessage(ChartView chartView, string? value) #Sets InputControl.ValidationMessage: The current validation message below the control, or null.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
chartView.ValidationMessage = value; chartView.ValidationMessage(value);public static ChartView ZoomLevel(ChartView chartView, int value) #Sets ChartView.ZoomLevel: The zoom level: 0 shows the whole X range and each level shows a narrower window.
Parameters
- chartView ConsoleMonster.Interactive.ChartView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
chartView.ZoomLevel = value; chartView.ZoomLevel(value);