Skip to content
ChartForgeX
Class

VisualCanvasKeyValueBlockLayer

ChartForgeX.Composition

Namespace
ChartForgeX.Composition
Assembly
ChartForgeX.Visuals
Modifiers
sealed

Reusable key/value text block with measured label columns and wrapped value text.

Inheritance

Constructors

public VisualCanvasKeyValueBlockLayer(double x, double y, double width, double height, IEnumerable<VisualCanvasKeyValueItem> items) #

Initializes a key/value text block layer.

Parameters

x double required
The block X coordinate.
y double required
The block Y coordinate.
width double required
The block width.
height double required
The initial block height.
items System.Collections.Generic.IEnumerable<ChartForgeX.Composition.VisualCanvasKeyValueItem> required
The key/value rows.

Methods

MeasureHeight 3 overloads
public double MeasureHeight() #

Measures the block height using the current text and wrapping settings and the default theme font family.

Returns

double
public double MeasureHeight(VisualTheme theme, ThemeMode mode = Light, VisualCanvasStyleOptions? style = null) #

Measures the block height with the font family the block draws with on a canvas using theme.

Parameters

theme ChartForgeX.Themes.VisualTheme required
mode ChartForgeX.ThemeMode = Light optional
style ChartForgeX.Composition.VisualCanvasStyleOptions? = null optional

Returns

double
public double MeasureHeight(VisualCanvas canvas) #

Measures using the exact shared theme, mode and local measurement settings of a canvas.

Parameters

canvas ChartForgeX.Composition.VisualCanvas required

Returns

double

Properties

public IReadOnlyList<VisualCanvasKeyValueItem> Items { get; } #

Gets the key/value rows.

public double LabelFontSize { get; set; } #

Gets or sets the label font size.

public double ValueFontSize { get; set; } #

Gets or sets the value font size.

public double ColumnGap { get; set; } #

Gets or sets the gap between label and value columns.

public double RowGap { get; set; } #

Gets or sets the gap between rows.

public double? LabelWidth { get; set; } #

Gets or sets an explicit label column width. When empty, the widest label is measured.

public double? ValueWrapWidth { get; set; } #

Gets or sets an explicit value wrap width. When empty, the remaining block width is used.

public ChartColor? LabelColorOverride { get; set; } #

Gets or sets an optional default label color override.

public ChartColor? ValueColorOverride { get; set; } #

Gets or sets an optional default value color override.

public string FontFamilyName { get; set; } #

Gets or sets the font family for this block. When empty, the canvas theme family is used by SVG and PNG output alike.

public bool LabelEmphasized { get; set; } #

Gets or sets whether labels use the emphasized text treatment.

public bool ValueEmphasized { get; set; } #

Gets or sets whether values use the emphasized text treatment.