HeatMapBuilder
public class HeatMapBuilderHelper class for creating HeatMap charts with automatic grid generation and color scale application. Matches Swift Charts' approach to heatmap creation.
Usage: var heatmap = HeatMapBuilder.Create(data, 10, 10) .ColorScale(global::ChartGuru.ColorScale.Viridis(0, 100)) .Build();
Methods
Section titled “Methods”
Create(float[,])
Section titled “Create(float[,])”public static HeatMapBuilder Create(float[,] data)Creates a new HeatMapBuilder from a 2D data array. Rows are Y-axis, columns are X-axis.
Parameters
| Name | Type | Description |
|---|---|---|
data | System.Single[,] | 2D array of values [row, col]. |
Returns
ChartGuru.HeatMapBuilder
Create(IList, int, int)
Section titled “Create(IList, int, int)”public static HeatMapBuilder Create(IList<float> values, int rows, int cols)Creates a new HeatMapBuilder from a flat list with specified dimensions.
Parameters
| Name | Type | Description |
|---|---|---|
values | System.Collections.Generic.IList{System.Single} | Flat list of Values (row-major order). |
rows | System.Int32 | Number of rows. |
cols | System.Int32 | Number of columns. |
Returns
ChartGuru.HeatMapBuilder
ColorScale(ColorScale)
Section titled “ColorScale(ColorScale)”public HeatMapBuilder ColorScale(ColorScale scale)Sets the color scale for mapping values to colors.
Parameters
| Name | Type |
|---|---|
scale | ChartGuru.ColorScale |
Returns
ChartGuru.HeatMapBuilder
CellPadding(float)
Section titled “CellPadding(float)”public HeatMapBuilder CellPadding(float padding)Sets padding between cells (as fraction of cell size).
Parameters
| Name | Type |
|---|---|
padding | System.Single |
Returns
ChartGuru.HeatMapBuilder
CornerRadius(float)
Section titled “CornerRadius(float)”public HeatMapBuilder CornerRadius(float radius)Sets corner radius for cells.
Parameters
| Name | Type |
|---|---|
radius | System.Single |
Returns
ChartGuru.HeatMapBuilder
RowLabels(params string[])
Section titled “RowLabels(params string[])”public HeatMapBuilder RowLabels(params string[] labels)Sets row labels (Y-axis categories).
Parameters
| Name | Type |
|---|---|
labels | System.String[] |
Returns
ChartGuru.HeatMapBuilder
ColumnLabels(params string[])
Section titled “ColumnLabels(params string[])”public HeatMapBuilder ColumnLabels(params string[] labels)Sets column labels (X-axis categories).
Parameters
| Name | Type |
|---|---|
labels | System.String[] |
Returns
ChartGuru.HeatMapBuilder
ShowLabels(bool)
Section titled “ShowLabels(bool)”public HeatMapBuilder ShowLabels(bool show)Enables or disables label display.
Parameters
| Name | Type |
|---|---|
show | System.Boolean |
Returns
ChartGuru.HeatMapBuilder
Build()
Section titled “Build()”public Chart Build()Builds the chart with all RectangleMarks for the heatmap.
Returns
ChartGuru.Chart
GetMarks()
Section titled “GetMarks()”public IEnumerable<RectangleMark> GetMarks()Gets the generated RectangleMarks for adding to an existing chart.
Returns
System.Collections.Generic.IEnumerable{ChartGuru.RectangleMark}