Project

ChartForgeX

Render deterministic charts, dashboards, topology, hierarchy, and report visuals directly from .NET.

Stars 47
Forks 2
NuGet downloads 75,067
Release ChartForgeX-v2.0.0
Language: HTML Updated: 2026-10-12

API Reference

Class

ChartGrid

Namespace ChartForgeX.Core
Assembly ChartForgeX
Modifiers sealed

Describes a dependency-free small-multiple report made from multiple charts.

Inheritance

  • Object
  • ChartGrid

Usage

Explore 79 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 53

Constructors

public ChartGrid() #

Methods

Add 2 overloads
public ChartGrid Add(Chart chart) #
Returns: ChartGrid

Adds a chart to the grid.

Parameters

chart ChartForgeX.Core.Chart requiredposition: 0
The chart to add.

Returns

The current chart grid.

public ChartGrid Add(Chart chart, Int32 columnSpan, Int32 rowSpan = 1) #
Returns: ChartGrid

Adds a chart to the grid with a panel span.

Parameters

chart ChartForgeX.Core.Chart requiredposition: 0
The chart to add.
columnSpan System.Int32 requiredposition: 1
The number of columns occupied by the chart panel.
rowSpan System.Int32 = 1 optionalposition: 2
The number of rows occupied by the chart panel.

Returns

The current chart grid.

public ChartGrid ConfigureSubtitleStyle(Action<TextStyleOverride> configure) #
Returns: ChartGrid

Configures grid subtitle text styling.

Parameters

configure System.Action<ChartForgeX.Typography.TextStyleOverride> requiredposition: 0
The style configuration callback.

Returns

The current chart grid.

public ChartGrid ConfigureTitleStyle(Action<TextStyleOverride> configure) #
Returns: ChartGrid

Configures grid title text styling.

Parameters

configure System.Action<ChartForgeX.Typography.TextStyleOverride> requiredposition: 0
The style configuration callback.

Returns

The current chart grid.

public static ChartGrid Create() #
Returns: ChartGrid

Creates a new chart grid.

Returns

A new chart grid instance.

public static ChartGrid FromFacets<T, TKey>(ChartDataset<T?> dataset, Func<T?, TKey?> facet, Func<TKey?, ChartDataset<T?>, Chart> chartFactory, Int32 columns = 2, IEqualityComparer<TKey?>? comparer = null) #
Returns: ChartGrid

Builds a small-multiple grid from deterministic dataset groups.

Type Parameters

T
TKey

Parameters

dataset ChartForgeX.Data.ChartDataset<T?> requiredposition: 0
facet System.Func<T?, TKey?> requiredposition: 1
chartFactory System.Func<TKey?, ChartForgeX.Data.ChartDataset<T?>, ChartForgeX.Core.Chart> requiredposition: 2
columns System.Int32 = 2 optionalposition: 3
comparer System.Collections.Generic.IEqualityComparer<TKey?>? = null optionalposition: 4
public IReadOnlyList<ChartGridPage> Paginate(Int32 maximumChartsPerPage = 6) #
Returns: IReadOnlyList<ChartGridPage>

Splits this grid into ordered pages with at most the specified number of charts.

Parameters

maximumChartsPerPage System.Int32 = 6 optionalposition: 0
The maximum chart count per page, independent of panel spans.

Returns

Read-only page metadata and independently configurable grids; an empty grid produces no pages.

public PreparedVisual Prepare(VisualRenderContext context) #
Returns: PreparedVisual

Prepares all panels once in the supplied fixed viewport with a shared theme and frame.

Parameters

context ChartForgeX.Rendering.VisualRenderContext requiredposition: 0
public ChartGrid WithAutomaticPanelSize() #
Returns: ChartGrid

Clears the fixed panel size so composed exports use the largest chart dimensions.

Returns

The current chart grid.

public ChartGrid WithAutomaticTheme() #
Returns: ChartGrid

Clears the grid theme so renderers use the first chart theme.

Returns

The current chart grid.

public ChartGrid WithColumns(Int32 columns) #
Returns: ChartGrid

Sets the preferred number of columns on wide viewports.

Parameters

columns System.Int32 requiredposition: 0
The preferred column count.

Returns

The current chart grid.

public ChartGrid WithGap(Int32 gap) #
Returns: ChartGrid

Sets the gap between charts in pixels.

Parameters

gap System.Int32 requiredposition: 0
The gap in pixels.

Returns

The current chart grid.

public ChartGrid WithPadding(Int32 padding) #
Returns: ChartGrid

Sets the outer padding around exported grid content in pixels.

Parameters

padding System.Int32 requiredposition: 0
The padding in pixels.

Returns

The current chart grid.

public ChartGrid WithPanelFit(VisualPanelFit fit) #
Returns: ChartGrid

Sets how charts fit inside fixed-size grid panels.

Parameters

fit ChartForgeX.Primitives.VisualPanelFit requiredposition: 0
The panel fit behavior.

Returns

The current chart grid.

public ChartGrid WithPanelSize(Int32 width, Int32 height) #
Returns: ChartGrid

Sets a fixed panel size for composed SVG and PNG grid exports.

Parameters

width System.Int32 requiredposition: 0
The panel width in pixels.
height System.Int32 requiredposition: 1
The panel height in pixels.

Returns

The current chart grid.

public ChartGrid WithPanelSpan(Int32 chartIndex, Int32 columnSpan, Int32 rowSpan = 1) #
Returns: ChartGrid

Sets the panel span for an existing chart in the grid.

Parameters

chartIndex System.Int32 requiredposition: 0
The zero-based chart index.
columnSpan System.Int32 requiredposition: 1
The number of columns occupied by the chart panel.
rowSpan System.Int32 = 1 optionalposition: 2
The number of rows occupied by the chart panel.

Returns

The current chart grid.

WithPngOutputScale 2 overloads
public ChartGrid WithPngOutputScale(Int32 scale) #
Returns: ChartGrid

Sets the output pixel multiplier used by composed PNG grid exports.

Parameters

scale System.Int32 requiredposition: 0
The output scale from one to four. Higher values emit larger PNG dimensions with the same logical grid layout.

Returns

The current chart grid.

public ChartGrid WithPngOutputScale(ChartPngOutputScale scale) #
Returns: ChartGrid

Sets the output pixel multiplier used by composed PNG grid exports using a named density preset.

Parameters

scale ChartForgeX.Core.ChartPngOutputScale requiredposition: 0
The output density preset.

Returns

The current chart grid.

public ChartGrid WithSharedAxes() #
Returns: ChartGrid

Applies shared cartesian x-axis and y-axis ranges to all compatible charts in the grid.

Returns

The current chart grid.

public ChartGrid WithSharedXAxis() #
Returns: ChartGrid

Applies one shared cartesian x-axis range to all compatible charts in the grid.

Returns

The current chart grid.

public ChartGrid WithSharedYAxis() #
Returns: ChartGrid

Applies one shared cartesian y-axis range to all compatible charts in the grid.

Returns

The current chart grid.

public ChartGrid WithSubtitle(String subtitle) #
Returns: ChartGrid

Sets the report subtitle.

Parameters

subtitle System.String requiredposition: 0
The report subtitle.

Returns

The current chart grid.

public ChartGrid WithSvgColorVariables(SvgColorVariables? variables) #
Returns: ChartGrid

Writes mapped colours in the grid SVG as CSS custom properties with the literal colour as fallback.

Parameters

variables ChartForgeX.Themes.SvgColorVariables? requiredposition: 0
The colour variables, or null to write literal colours.

Returns

The current grid.

public ChartGrid WithTheme(ChartTheme theme) #
Returns: ChartGrid

Sets the theme used by the grid background and heading.

Parameters

theme ChartForgeX.Themes.ChartTheme requiredposition: 0
The grid theme.

Returns

The current chart grid.

public ChartGrid WithTitle(String title) #
Returns: ChartGrid

Sets the report title.

Parameters

title System.String requiredposition: 0
The report title.

Returns

The current chart grid.

Properties

public String Title { get; set; } #

Gets or sets the report title.

public String Subtitle { get; set; } #

Gets or sets the report subtitle.

public Int32 Columns { get; set; } #

Gets or sets the preferred number of columns on wide viewports.

public Boolean PreserveEmptyColumns { get; set; } #

Gets or sets whether composed SVG and PNG exports retain columns without charts.

public Int32 Gap { get; set; } #

Gets or sets the gap between charts in pixels.

public Int32 Padding { get; set; } #

Gets or sets the outer padding around exported grid content in pixels.

public Int32 PngOutputScale { get; set; } #

Gets or sets the output pixel multiplier used by composed PNG grid exports.

public ChartSize? PanelSize { get; set; } #

Gets or sets the optional fixed panel size used by composed SVG and PNG grid exports.

public VisualPanelFit PanelFit { get; set; } #

Gets or sets how charts fit inside fixed-size grid panels.

public ChartTheme? Theme { get; set; } #

Gets or sets the optional theme used by the grid background and heading.

public TextStyleOverride TitleStyle { get; } #

Gets the text style used for the grid title.

public TextStyleOverride SubtitleStyle { get; } #

Gets the text style used for the grid subtitle.

public IReadOnlyList<Chart> Charts { get; } #

Gets the charts included in the grid.

public IReadOnlyList<ChartGridPanelSpan> PanelSpans { get; } #

Gets the panel spans for charts included in the grid.

public VisualAccessibility Accessibility { get; } #

Gets the text alternative for the complete chart comparison.

public SvgColorVariables? SvgColorVariables { get; set; } #

Gets or sets the CSS custom properties the grid SVG writes for mapped colours (see SvgColorVariables): the grid title, background, and every panel, including charts without their own variables. Null (the default) writes literal colours; PNG output always uses literal colours.

Extension Methods

public static ChartGrid ConfigureTheme(ChartGrid grid, Action<ChartTheme> configure) #
Returns: ChartGrid

Configures the current chart grid theme in place, creating a light grid theme when the grid is currently automatic.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to configure.
configure System.Action<ChartForgeX.Themes.ChartTheme> requiredposition: 1
The theme customization callback.

Returns

The current chart grid.

public static Void Save(ChartGrid grid, String path, RasterImageOptions? rasterOptions = null) #
Returns: Void

Saves a chart grid using the output path extension to choose SVG, HTML, PNG, or another raster image format.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
rasterOptions ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Void SaveBmp(ChartGrid grid, String path, RasterImageOptions? options = null) #
Returns: Void

Saves a chart grid as a BMP file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Void SaveHtml(ChartGrid grid, String path) #
Returns: Void

Saves a chart grid as a complete HTML file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
public static Void SavePng(ChartGrid grid, String path) #
Returns: Void

Saves a chart grid as a PNG file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
public static Void SavePpm(ChartGrid grid, String path, RasterImageOptions? options = null) #
Returns: Void

Saves a chart grid as a PPM file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
SaveRasterImage 2 overloads
public static Void SaveRasterImage(ChartGrid grid, String path, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Void

Saves a chart grid as an opaque raster image file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
format ChartForgeX.Core.RasterImageFormat requiredposition: 2
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 3
Optional raster export options.
public static Void SaveRasterImage(ChartGrid grid, String path, RasterImageOptions? options = null) #
Returns: Void

Saves a chart grid as an opaque raster image file using the output path extension to choose the format.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Void SaveSvg(ChartGrid grid, String path) #
Returns: Void

Saves a chart grid as an SVG file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
public static Void SaveTiff(ChartGrid grid, String path, RasterImageOptions? options = null) #
Returns: Void

Saves a chart grid as a TIFF file.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
path System.String requiredposition: 1
The output file path.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Byte[] ToBmp(ChartGrid grid, RasterImageOptions? options = null) #
Returns: Byte[]

Renders a chart grid to BMP bytes.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 1
Optional raster export options.

Returns

A BMP image.

ToHtmlFragment 2 overloads
public static String ToHtmlFragment(ChartGrid grid) #
Returns: String

Renders a chart grid to a standalone HTML fragment containing inline SVG charts.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.

Returns

An HTML fragment.

public static String ToHtmlFragment(ChartGrid grid, String idScope) #
Returns: String

Renders a chart grid to an HTML fragment with an additional deterministic ID scope.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
idScope System.String requiredposition: 1
A caller-provided scope used to keep IDs unique when embedding equivalent fragments together.

Returns

An HTML fragment.

public static String ToHtmlPage(ChartGrid grid) #
Returns: String

Renders a chart grid to a complete HTML document.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.

Returns

An HTML page.

public static Byte[] ToPng(ChartGrid grid) #
Returns: Byte[]

Renders a chart grid to PNG bytes.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.

Returns

A PNG image.

public static Byte[] ToPpm(ChartGrid grid, RasterImageOptions? options = null) #
Returns: Byte[]

Renders a chart grid to PPM bytes.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 1
Optional raster export options.

Returns

A PPM image.

public static Byte[] ToRasterImage(ChartGrid grid, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Byte[]

Renders a chart grid to opaque raster image bytes.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
format ChartForgeX.Core.RasterImageFormat requiredposition: 1
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.

Returns

Encoded raster image bytes.

public static RgbaImage ToRgbaImage(ChartGrid grid) #
Returns: RgbaImage

Renders a chart grid directly to an in-memory RGBA image without encoding it.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.

Returns

The rendered RGBA image.

ToSvg 2 overloads
public static String ToSvg(ChartGrid grid) #
Returns: String

Renders a chart grid to SVG markup.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.

Returns

SVG markup.

public static String ToSvg(ChartGrid grid, String idScope) #
Returns: String

Renders a chart grid to SVG markup with an additional deterministic ID scope.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
idScope System.String requiredposition: 1
A caller-provided scope used to keep SVG element IDs unique when embedding multiple SVG grids in one document.

Returns

SVG markup.

public static Byte[] ToTiff(ChartGrid grid, RasterImageOptions? options = null) #
Returns: Byte[]

Renders a chart grid to TIFF bytes.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 1
Optional raster export options.

Returns

A TIFF image.

public static VisualArtifact ToVisualArtifact(ChartGrid grid, String? id = null, VisualArtifactSourceLanguage sourceLanguage = Native) #
Returns: VisualArtifact

Wraps a chart grid in a reusable visual artifact.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
id System.String? = null optionalposition: 1
sourceLanguage ChartForgeX.VisualArtifacts.VisualArtifactSourceLanguage = Native optionalposition: 2
public static ChartGrid WithBrandKit(ChartGrid grid, ChartBrandKit brandKit) #
Returns: ChartGrid

Applies a reusable brand kit to the current chart grid theme, creating a light grid theme when the grid is currently automatic.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to configure.
brandKit ChartForgeX.Themes.ChartBrandKit requiredposition: 1
The brand kit to apply.

Returns

The current chart grid.

public static Void WriteBmp(ChartGrid grid, Stream stream, RasterImageOptions? options = null) #
Returns: Void

Writes a chart grid to a BMP stream.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
stream System.IO.Stream requiredposition: 1
The destination stream.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Void WritePpm(ChartGrid grid, Stream stream, RasterImageOptions? options = null) #
Returns: Void

Writes a chart grid to a PPM stream.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
stream System.IO.Stream requiredposition: 1
The destination stream.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Void WriteRasterImage(ChartGrid grid, Stream stream, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Void

Writes a chart grid to an opaque raster image stream.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
stream System.IO.Stream requiredposition: 1
The destination stream.
format ChartForgeX.Core.RasterImageFormat requiredposition: 2
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 3
Optional raster export options.
public static Void WriteTiff(ChartGrid grid, Stream stream, RasterImageOptions? options = null) #
Returns: Void

Writes a chart grid to a TIFF stream.

Parameters

grid ChartForgeX.Core.ChartGrid requiredposition: 0
The chart grid to render.
stream System.IO.Stream requiredposition: 1
The destination stream.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.