Skip to content
ConsoleMonster
Class

ChartView

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

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

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.

Accepted by parameters 26

Constructors

public ChartView(string key, ChartPlot chart) #

Explores a chart: a LineChart (converted implicitly), or any other ChartPlot.

Parameters

key string required
The application-state key holding the index of the point under the crosshair.
chart ConsoleMonster.Interactive.ChartPlot required
The chart; a LineChart keeps drawing the same outside an app.

Methods

public bool IsHidden(int series) #

Whether a series (by its position, from 0) is hidden.

Parameters

series int required
The series position.

Returns

bool True when hidden.
public void SetHidden(int series, bool hidden) #

Hides or shows a series by its position, from 0.

Parameters

series int required
The series position.
hidden bool required
Whether to hide it.

Properties

public ChartPlot Chart { get; } #

The chart explored.

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.

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 required
The instance.
item ConsoleMonster.Interactive.KeyBinding required
The item.

Returns

ChartView The same instance.
AddBindings 2 overloads
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 required
The instance.
items ConsoleMonster.Interactive.KeyBinding[] required
The items, in order.

Returns

ChartView The same instance.
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 required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.KeyBinding> required
The items, in order.

Returns

ChartView The same instance.
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 required
The instance.
item string required
The item.

Returns

ChartView The same instance.
AddPointLabels 2 overloads
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 required
The instance.
items string[] required
The items, in order.

Returns

ChartView The same instance.
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 required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

ChartView The same instance.
Disabled 2 overloads
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 required
The instance.
value bool required
The value.

Returns

ChartView The same instance.

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 required
The instance to configure.

Returns

ChartView The same instance.
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 required
The instance.
value int required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value string? required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value string? required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value double required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value int required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value int required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value string? required
The value.

Returns

ChartView The same instance.

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 required
The instance.
value int required
The value.

Returns

ChartView The same instance.

Examples

// C# initializer or property    // C# fluent
chartView.ZoomLevel = value;     chartView.ZoomLevel(value);