Skip to content
ConsoleMonster

API Reference

Class

Histogram

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
Modifiers sealed

Vertical bars for a distribution: values are counted into buckets defined by edges, bars grow with eighth-block precision, the largest count labels the top and bucket labels sit under the bars. Live operation: add (Value).

Inheritance

Usage

Explore 17 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 8

Constructors

public Histogram(IReadOnlyList<Double> edges, String name = "histogram") #

Creates a histogram.

Parameters

edges System.Collections.Generic.IReadOnlyList<System.Double> requiredposition: 0
Ascending bucket edges; values below the first edge go to the first bucket, values at or above the last edge to the last.
name System.String = "histogram" optionalposition: 1
The live name (default histogram).

Methods

public Histogram Add(Double value) #
Returns: Histogram

Counts a value.

Parameters

value System.Double requiredposition: 0
The value.

Returns

This instance.

public override Void Apply(LiveEvent liveEvent) #
Returns: Void

Applies an event to the widget's state.

Parameters

liveEvent ConsoleMonster.Live.LiveEvent requiredposition: 0
The event.
public SparklineHandle Handle(ILiveDispatcher dispatcher) #
Returns: SparklineHandle

Returns a handle that adds values through a dispatcher.

Parameters

dispatcher ConsoleMonster.Live.ILiveDispatcher requiredposition: 0
The dispatcher.

Returns

The handle.

public override Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public override Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public IReadOnlyList<Int32> Counts { get; } #

Bucket counts.

public Int32 Height { get; set; } #

Rows for the bars (default 6).

public ThemeToken Token { get; set; } #

The bar colour token (default ThemeToken.Series1).

public String? Unit { get; set; } #

A unit for bucket labels (for example s).

public Func<Double, String>? EdgeFormat { get; set; } #

Formats the bucket edge labels (for example milliseconds as 250ms and 1s), or null for the compact number and Histogram.Unit.

Extension Methods

public static Histogram WithEdgeFormat(Histogram histogram, Func<Double, String>? value) #
Returns: Histogram

Sets Histogram.EdgeFormat: Formats the bucket edge labels (for example milliseconds as 250ms and 1s), or null for the compact number and Histogram.Unit.

Parameters

histogram ConsoleMonster.Widgets.Histogram requiredposition: 0
The instance.
value System.Func<System.Double, System.String>? requiredposition: 1
The value.

Returns

The same instance.

public static Histogram WithHeight(Histogram histogram, Int32 value) #
Returns: Histogram

Sets Histogram.Height: Rows for the bars (default 6).

Parameters

histogram ConsoleMonster.Widgets.Histogram requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static Histogram WithToken(Histogram histogram, ThemeToken value) #
Returns: Histogram

Sets Histogram.Token: The bar colour token (default ThemeToken.Series1).

Parameters

histogram ConsoleMonster.Widgets.Histogram requiredposition: 0
The instance.
value ConsoleMonster.Styling.ThemeToken requiredposition: 1
The value.

Returns

The same instance.

public static Histogram WithUnit(Histogram histogram, String? value) #
Returns: Histogram

Sets Histogram.Unit: A unit for bucket labels (for example s).

Parameters

histogram ConsoleMonster.Widgets.Histogram requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.