Skip to content
ConsoleMonster
Class

ChartPlot

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
abstract

What a ChartView explores, so any chart can take its crosshair, legend toggles, zoom and pan: points along X (index 0 to ChartPlot.Count - 1), each series' value at a point, and a drawing at a zoom level and pan position. A level shows a fixed fraction of the X domain; the pan fraction places that window, 0 at the start and 1 at the end. LineChart computes any level; ConsoleMonster.Graphics draws a ChartForgeX chart from the levels ChartForgeX prepared.

Inheritance

  • object
  • ChartPlot

Usage

Explore 7 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 3

Methods

public virtual bool CanHide(int series) #

Whether a series can be hidden (default: every series).

Parameters

series int required
The series position, from 0.

Returns

bool True when it can be hidden.
public abstract string FormatValue(double value, RenderContext context) #

A value as the readout shows it, with its unit.

Parameters

value double required
The value.
context ConsoleMonster.Canvas.RenderContext required
The render context, for its culture.

Returns

string The text.
public abstract double Magnification(int level) #

The magnification a level is read out as (1 at level 0).

Parameters

level int required
The level.

Returns

double The magnification.
public abstract Size Measure(Constraints constraints, RenderContext context) #

The natural size of the drawing.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The available space.
context ConsoleMonster.Canvas.RenderContext required
The render context.

Returns

Size The size.
public static ChartPlot op_Implicit(LineChart chart) #

Explores a native line chart: its points are value indices, aligned from each series' first value.

Parameters

chart ConsoleMonster.Widgets.LineChart required
The chart.

Returns

ChartPlot
public abstract double Position(int index) #

Where a point sits in the X domain, from 0 to 1.

Parameters

index int required
The point index.

Returns

double The position.
public abstract ChartPlotLayout Render(Region region, RenderContext context, int level, double pan, ICollection<int> hidden) #

Draws the window a level and pan show, without the hidden series, and reports where it drew.

Parameters

region ConsoleMonster.Canvas.Region required
The area below the readout row.
context ConsoleMonster.Canvas.RenderContext required
The render context.
level int required
The zoom level.
pan double required
The pan fraction, from 0 to 1.
hidden System.Collections.Generic.ICollection<int> required
The positions of the hidden series.

Returns

ChartPlotLayout The plot area, the column of each point and the legend entries.
public abstract string SeriesName(int series) #

A series' name, read out with its value.

Parameters

series int required
The series position, from 0.

Returns

string The name.
public abstract Style SeriesStyle(int series, RenderContext context) #

The style of a series' number in the readout and legend.

Parameters

series int required
The series position, from 0.
context ConsoleMonster.Canvas.RenderContext required
The render context.

Returns

Style The style.
public abstract double? Value(int series, int index) #

A series' value at a point, or null where it has none.

Parameters

series int required
The series position, from 0.
index int required
The point index.

Returns

double? The value.
public abstract double WindowFraction(int level) #

The fraction of the X domain a level shows (1 at level 0).

Parameters

level int required
The level.

Returns

double The fraction.
public abstract string? XLabel(int index, RenderContext context) #

A label for a point when the view has none of its own, or null to show its number.

Parameters

index int required
The point index.
context ConsoleMonster.Canvas.RenderContext required
The render context.

Returns

string? The label.

Properties

public abstract int Count { get; } #

The number of points along X.

public abstract int SeriesCount { get; } #

The number of series.

public abstract int Levels { get; } #

The number of zoom levels, at least one; level 0 shows the whole X domain.