BarMark<T> Class

Draws a bar per row: a band of the x scale (a category), from the baseline to the y value. With a StackTransform, the bars of a category are stacked; with BarMark<T>.Group, they are side by side. Transposed coordinates make horizontal bars; polar coordinates make a rose (or radial bars, transposed).

public sealed class BarMark<T> : Mark<T>

Type parameters

T
The type of the rows.
Inheritance
Mark<T> BarMark<T>

Constructors

NameDescription
BarMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>)Initializes a new instance of the BarMark<T> class.

BarMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>)

BarMark.cs

Initializes a new instance of the BarMark<T> class.

public BarMark(IEnumerable<T> data, Func<T, object?> x, Func<T, object?> y)

Parameters

data IEnumerable<T>
The rows.
x Func<T, object?>
The channel of the category of the bar.
y Func<T, object?>
The channel of the value of the bar.

Properties

NameDescription
BarWidthGets or sets the width of a bar, as a fraction of its band (or of its share of the band, for grouped bars), centered in it. The default is 1. A narrower bar can sit in a wider one, as in bullet charts.
CornerRadiusGets or sets the radius of the corners of the bars. The default is 0.
GroupGets or sets the channel that divides each band into side-by-side bars (grouped bars), or null.
GroupPaddingGets or sets the space between the bars of a group, as a fraction of their width. The default is 0.05.
SeriesGets or sets the channel of the series to stack, when it differs from Mark<T>.Fill.
XGets the channel of the category of the bar.
YGets the channel of the value of the bar.

BarWidth

BarMark.cs

Gets or sets the width of a bar, as a fraction of its band (or of its share of the band, for grouped bars), centered in it. The default is 1. A narrower bar can sit in a wider one, as in bullet charts.

public double BarWidth { get; set; }

Property value

double

Exceptions

ArgumentOutOfRangeException
The value is not between 0 and 1.

CornerRadius

BarMark.cs

Gets or sets the radius of the corners of the bars. The default is 0.

public double CornerRadius { get; set; }

Property value

double

Gets or sets the channel that divides each band into side-by-side bars (grouped bars), or null.

public Func<T, object?>? Group { get; set; }

Property value

Func<T, object?>?

GroupPadding

BarMark.cs

Gets or sets the space between the bars of a group, as a fraction of their width. The default is 0.05.

public double GroupPadding { get; set; }

Property value

double

Gets or sets the channel of the series to stack, when it differs from Mark<T>.Fill.

public Func<T, object?>? Series { get; set; }

Property value

Func<T, object?>?

Gets the channel of the category of the bar.

public Func<T, object?> X { get; }

Property value

Func<T, object?>

Gets the channel of the value of the bar.

public Func<T, object?> Y { get; }

Property value

Func<T, object?>