Skip to content
ConsoleMonster
Class

DataBarPresenter

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Implements
ICellPresenter
Modifiers
sealed

A number with a data bar in the cell, scaled to DataBarPresenter.Maximum or the column maximum: ▆▆▆▆▆▆▆ 412. The number stays visible, so the cell reads the same without colour.

Inheritance

  • object
  • DataBarPresenter

Constructors

public DataBarPresenter(double? maximum = null, ICellPresenter? number = null, int barWidth = 10) #

Creates a data bar presenter.

Parameters

maximum double? = null optional
The value of a full bar, or null for the column maximum.
number ConsoleMonster.Presenters.ICellPresenter? = null optional
How the number is formatted (default NumberPresenter).
barWidth int = 10 optional
Cells the bar would like (default 10).

Methods

public PresentedValue Present(object? value, PresenterContext context) #

Presents a value.

Parameters

value object? required
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext required
Culture, clock, time zone, column statistics and the render context.

Returns

PresentedValue The presented value.

Properties

public double? Maximum { get; } #

The value of a full bar, or null for the column maximum.

public ICellPresenter NumberFormat { get; } #

How the number is formatted.

public int BarWidth { get; } #

Cells the bar would like.

public bool ShowRoleMarker { get; set; } #

Whether a matching health role uses a symbol (default true) or its status word after the numeric value. Accessible mode keeps the symbol.

public int ValuePadding { get; set; } #

Optional spaces before the value, keeping numeric labels aligned when role markers follow them.