Skip to content
ConsoleMonster
Class

PipelineChart

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

Shapes numeric samples into existing chart widgets. Bars retain individual observations; sparklines group by label, preserving arrival order. No-colour output lists values, bucket counts or every trend sample as text.

Inheritance

  • object
  • PipelineChart

Usage

Explore 21 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 10

Constructors

public PipelineChart() #

Methods

public PipelineChart Add(string? label, double value) #

Adds a finite sample. Labels are literal text; a null label joins the unnamed trend.

Parameters

label string? required
The sample or group label.
value double required
A finite number; NaN and infinity are rejected.

Returns

PipelineChart This chart.
public IWidget Build(bool textOnly = false) #

Builds a snapshot using the existing renderers, or literal text when colour is unavailable.

Parameters

textOnly bool = false optional
Whether to return numerical text instead of chart glyphs.

Returns

IWidget A widget for the selected samples; an empty chart has no rows.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.
public static bool TryNumber(object? value, out double number) #

Parses a scalar number without treating booleans, dates, null or whitespace as zero.

Parameters

value object? required
A numeric primitive, decimal or invariant numeric string.
number double required
The finite value when successful; zero otherwise.

Returns

bool Whether the input is a finite numeric scalar.

Properties

public IReadOnlyList<ChartItem> Samples { get; } #

Valid samples in arrival order. Adding a repeated label does not replace an earlier observation.

public PipelineChartType Type { get; set; } #

The chart presentation; defaults to horizontal bars.

public PipelineChartSort Sort { get; set; } #

Value order before Top; ties retain arrival order. Histogram observations are never sorted or limited.

public int Top { get; set; } #

Maximum bars or trend groups to show; zero shows all. Histogram always uses every valid sample.

public int Bins { get; set; } #

Requested histogram bucket count, from 1 through 128. Integral samples use whole-number edges.

public string? Unit { get; set; } #

A unit appended to values and bucket edges.

Extension Methods

public static PipelineChart WithBins(PipelineChart pipelineChart, int value) #

Sets PipelineChart.Bins: Requested histogram bucket count, from 1 through 128. Integral samples use whole-number edges.

Parameters

pipelineChart ConsoleMonster.Widgets.PipelineChart required
The instance.
value int required
The value.

Returns

PipelineChart The same instance.
public static PipelineChart WithSort(PipelineChart pipelineChart, PipelineChartSort value) #

Sets PipelineChart.Sort: Value order before Top; ties retain arrival order. Histogram observations are never sorted or limited.

Parameters

pipelineChart ConsoleMonster.Widgets.PipelineChart required
The instance.
value ConsoleMonster.Widgets.PipelineChartSort required
The value.

Returns

PipelineChart The same instance.
public static PipelineChart WithTop(PipelineChart pipelineChart, int value) #

Sets PipelineChart.Top: Maximum bars or trend groups to show; zero shows all. Histogram always uses every valid sample.

Parameters

pipelineChart ConsoleMonster.Widgets.PipelineChart required
The instance.
value int required
The value.

Returns

PipelineChart The same instance.
public static PipelineChart WithType(PipelineChart pipelineChart, PipelineChartType value) #

Sets PipelineChart.Type: The chart presentation; defaults to horizontal bars.

Parameters

pipelineChart ConsoleMonster.Widgets.PipelineChart required
The instance.
value ConsoleMonster.Widgets.PipelineChartType required
The value.

Returns

PipelineChart The same instance.
public static PipelineChart WithUnit(PipelineChart pipelineChart, string? value) #

Sets PipelineChart.Unit: A unit appended to values and bucket edges.

Parameters

pipelineChart ConsoleMonster.Widgets.PipelineChart required
The instance.
value string? required
The value.

Returns

PipelineChart The same instance.