Skip to content

ScatterChartWidget<T>

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A widget that displays a scatter plot using braille characters for sub-cell precision.

csharp
public sealed record ScatterChartWidget<T> : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<ScatterChartWidget<T>>

Inheritance

ObjectHex1bWidgetScatterChartWidget<T>

Implements

Properties

Data

Gets the data source for the chart.

Returns: IReadOnlyList<<T>>

csharp
public IReadOnlyList<T>? Data { get; init; }

Methods

FormatX(Func<double, string>)

Sets a custom X value formatter.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> FormatX(Func<double, string> formatter)

FormatY(Func<double, string>)

Sets a custom Y value formatter.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> FormatY(Func<double, string> formatter)

GroupBy(Func<T, string>)

Sets the function that groups data into color-coded series.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> GroupBy(Func<T, string> groupSelector)

ShowGridLines(bool)

Sets whether to display grid lines.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> ShowGridLines(bool show = true)

Title(string)

Sets the chart title.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> Title(string title)

X(Func<T, double>)

Sets the function that extracts the X-axis value from each data item.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> X(Func<T, double> selector)

XRange(double, double)

Sets the explicit X-axis range.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> XRange(double min, double max)

Y(Func<T, double>)

Sets the function that extracts the Y-axis value from each data item.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> Y(Func<T, double> selector)

YRange(double, double)

Sets the explicit Y-axis range.

Parameters:

Returns: ScatterChartWidget`1

csharp
public ScatterChartWidget<T> YRange(double min, double max)

Remarks

Points are NOT connected by lines. Each data point plots a single braille dot. Multiple series can be created via to color-code groups.

Examples

Create a scatter chart with grouped series:

csharp
var app = new Hex1bApp(ctx =>
    ctx.ScatterChart(data)
        .X(d => d.Height)
        .Y(d => d.Weight)
        .GroupBy(d => d.Category)
        .Title("Height vs Weight")
);

Released under the MIT License.