Charts
Four dependency-free SVG chart types: LineChart, BarChart, AreaChart, and PieChart. All four share a common base that handles the responsive SVG surface, the series/palette model, observable-driven re-rendering, tippy tooltips, and the role="img" accessibility summary. Rendering style mirrors [[Sparkline]].
Each chart fills its container via a ResizeObserver and re-paints on every size change. Data can be supplied as plain double[] arrays or as observables that push updates; subscriptions are released automatically when the component leaves the DOM.
Chart types
| Type | Factory | Use for |
|---|---|---|
LineChart |
UI.LineChart() |
Trends over ordered categories; fits data range (no forced zero baseline) |
BarChart |
UI.BarChart() |
Category comparisons; grouped bars; always reads against a zero baseline |
AreaChart |
UI.AreaChart() |
Filled trend regions with a gradient under the line; zero baseline |
PieChart |
UI.PieChart() |
Part-to-whole; can render as a donut via .Donut() |
Common API (all chart types)
All charts expose the methods below through ChartBase<T> and, for the cartesian types, CartesianChartBase<T>.
Data and series
.Data(double[] values)— single unnamed series..Series(params ChartSeries[] series)— replace all series at once..Series(string name, double[] values, string color = null)— append one named series..Series(IObservable<double[]> values, string name = null, string color = null)— bind a single series to an observable..Series(IObservable<ChartSeries[]> series)— bind all series to an observable.
Appearance
.Colors(params string[] palette)— replace the default eight-color theme palette. Colors are CSS values; the default palette usesTheme.Colors.*variables that adapt to light/dark mode..Tooltips(bool show = true)— enable or disable tippy popovers on each data point/bar/slice. Native<title>elements are always written regardless of this flag..Legend(bool show = true)— show a swatch + label legend..Title(string title)— set an explicitaria-labelon the chart container; used as the accessibility summary instead of the auto-generated description..FormatValues(Func<double, string> formatter)— override how values are displayed in tooltips and axis labels. Default:"0.##".
Cartesian charts only (LineChart, BarChart, AreaChart)
.XAxis(params string[] categories)— category labels along the X axis..XAxisTitle(string title)— X axis title, shown below the category labels..YAxisTitle(string title)— Y axis title..Grid(bool show = true)— horizontal gridlines (default: on)..Axes(bool show = true)— axis lines and value/category labels (default: on).
LineChart and AreaChart
.Points(bool show = true)— show or hide the per-point circle markers (default: on).
BarChart
.Rounded(double radius = 2)— corner radius on each bar rectangle.
PieChart
.Labels(params string[] labels)— per-slice labels, used in the legend and tooltips..Donut(double holeRatio = 0.6)— render as a donut with a cutout sized as a fraction (0–0.95) of the radius.
ChartSeries
ChartSeries carries one named data series:
new ChartSeries(string name, double[] values, string color = null)
name— display name shown in the legend and tooltips. Passnullfor an unnamed series.values— one value per category/point.color— explicit CSS color; whennullthe chart assigns a palette color by index.
Usage examples
Line chart with two series and category labels
Bar chart with grouped series
Area chart with observable data
Pie chart and donut chart
API reference
public enum ChartLegendPositionWhere a chart draws its legend.
- Namespace
- Tesserae
public sealed class ChartRangeThe visible X range of a cartesian chart, reported when the user zooms or pans.
- Namespace
- Tesserae
Constructors
| Name | Description |
|---|---|
| ChartRange | Initializes a new instance of the ChartRange class. |
Properties
| Name | Description |
|---|---|
| Min | The lowest visible X value. |
| Max | The highest visible X value. |
| IsAutoRange | True when the chart is back to fitting its data instead of showing an explicit range. |
public sealed class ChartSeriesA single named data series for a chart, with an optional explicit color (falling back to the chart palette).
- Namespace
- Tesserae
Constructors
| Name | Description |
|---|---|
| ChartSeries | Initializes a new instance of the ChartSeries class. |
| Overload | |
|---|---|
| ChartSeries(string, double[], string) | Initializes a new instance of the ChartSeries class. |
| ChartSeries(string, double[], double[], string) | Initializes a new instance of the ChartSeries class with explicit X positions, putting the chart on a continuous X scale. |
ChartSeries(string, double[], string)
public ChartSeries(string name, double[] values, string color = null)Initializes a new instance of the ChartSeries class.
Parameters
- name string
- values double[]
- color string
ChartSeries(string, double[], double[], string)
public ChartSeries(string name, double[] xValues, double[] values, string color = null)Initializes a new instance of the ChartSeries class with explicit X positions, putting the chart on a continuous X scale.
Parameters
- name string
- xValues double[]
- values double[]
- color string
Properties
| Name | Description |
|---|---|
| Name | The series display name, used in the legend, tooltips and accessibility summary. |
| Values | The series values, one per category/point. NaN marks a missing sample. |
| Color | An optional explicit CSS color; when null the chart assigns a palette color by index. |
| XValues | Optional X positions for this series' values, one per entry in Values. Setting these on any series switches the chart to a continuous X scale, which lets each series carry its own X positions (irregular sampling, differing time windows, differing point counts) instead of sharing one category list. |
| LineWidth | The stroke width of this series' line, in pixels (line and area charts). |
| FillOpacity | The opacity of this series' area fill at its peak, fading to near-transparent at the baseline (area charts). |
public string Name { get; set; }The series display name, used in the legend, tooltips and accessibility summary.
public double[] Values { get; set; }The series values, one per category/point. NaN marks a missing sample.
public string Color { get; set; }An optional explicit CSS color; when null the chart assigns a palette color by index.
public double[] XValues { get; set; }Optional X positions for this series' values, one per entry in Values. Setting these on any series switches the chart to a continuous X scale, which lets each series carry its own X positions (irregular sampling, differing time windows, differing point counts) instead of sharing one category list.
public double LineWidth { get; set; }The stroke width of this series' line, in pixels (line and area charts).
public abstract class ChartBase<T> : IComponent where T : ChartBase<T>Shared base for Tesserae's lightweight, dependency-free SVG charts. Handles the responsive SVG surface (sized 1:1 to its container via a ResizeObserver), the series/palette model, observable-driven re-rendering, theme colors, tooltips (reusing tippy), PNG export and the role="img" accessibility summary. Mirrors Sparkline's SVG rendering style.
- Namespace
- Tesserae
- Implements
- IComponent
Constructors
| Name | Description |
|---|---|
| ChartBase | Initializes a new instance of the ChartBase{T} class. |
Methods
| Name | Description |
|---|---|
| FormatValueCompact | The default value format: large magnitudes are abbreviated with an SI prefix, because an axis of byte counts or token totals is unreadable at full length. Small values are left alone. Override with FormatValues. |
| Data | Replaces the chart's series with a single unnamed series of plain values. |
| Series | Replaces the chart's series. |
| Colors | Sets the series color palette (used for series without an explicit color). |
| Tooltips | Enables or disables per-element tooltips. |
| Legend | Enables or disables the legend. |
| ConnectGaps | When true (the default) a line or area series draws straight across a NaN value; when false the line breaks, leaving the gap visible. |
| Title | Sets an accessibility caption / summary for the chart. |
| FormatValues | Sets the formatter used for values in tooltips and labels. |
| ExportButton | Shows a small download button in the chart's top-right corner (revealed on hover) that saves the chart as a PNG. |
| ExportPng | Saves the chart as a PNG. CSS-variable colors are resolved to concrete values first, so the exported image matches the theme the chart is currently rendered in. |
| ColorFor | Returns the color for the series at the given index (explicit color or palette by index). |
| El | Creates an SVG element in the SVG namespace. |
| Attr | Sets an attribute on an SVG element (double values are invariant-formatted). |
| AttachPointTooltip | Attaches a hover tooltip to an SVG element: a native <title> child (for accessibility / no-JS fallback) and, when enabled, a tippy popover reusing the bundled tippy.js. |
| ClearSvg | Removes every child of the SVG surface. |
| QueueRender | Schedules a render on the next animation frame, coalescing bursts of changes. |
| RenderChart | Draws the chart into the SVG surface at the given pixel dimensions. |
| BuildAriaLabel | Builds the accessibility summary describing the chart's data. |
| ResetLegendInsets | Clears the space reserved for the legend, before a fresh render measures it again. |
| RenderLegend | Renders the legend for the chart's series, recording the space it consumed in the legend insets. |
| Render | Renders the component's root HTML element. |
protected static string FormatValueCompact(double value)The default value format: large magnitudes are abbreviated with an SI prefix, because an axis of byte counts or token totals is unreadable at full length. Small values are left alone. Override with FormatValues.
public T Data(double[] values)Replaces the chart's series with a single unnamed series of plain values.
| Overload | |
|---|---|
| Series(ChartSeries[]) | Replaces the chart's series. |
| Series(string, double[], string) | Appends a single named series of plain values. |
| Series(IObservable<double[]>, string, string) | Binds a single series to an observable sequence of values: the chart re-renders whenever the observable changes. The subscription is released when the chart leaves the DOM. |
| Series(IObservable<ChartSeries[]>) | Binds the chart to an observable list of series, re-rendering on every change. |
Series(ChartSeries[])
public T Series(params ChartSeries[] series)Replaces the chart's series.
Parameters
- series ChartSeries[]
Series(string, double[], string)
public T Series(string name, double[] values, string color = null)Appends a single named series of plain values.
Parameters
- name string
- values double[]
- color string
Series(IObservable<double[]>, string, string)
public T Series(IObservable<double[]> values, string name = null, string color = null)Binds a single series to an observable sequence of values: the chart re-renders whenever the observable changes. The subscription is released when the chart leaves the DOM.
Parameters
- values IObservable<double[]>
- name string
- color string
public T Colors(params string[] palette)Sets the series color palette (used for series without an explicit color).
public T Tooltips(bool show = true)Enables or disables per-element tooltips.
| Overload | |
|---|---|
| Legend(bool) | Enables or disables the legend. |
| Legend(ChartLegendPosition) | Sets which edge of the chart the legend is drawn on (and enables it). |
public T ConnectGaps(bool connect = true)When true (the default) a line or area series draws straight across a NaN value; when false the line breaks, leaving the gap visible.
public T Title(string title)Sets an accessibility caption / summary for the chart.
public T FormatValues(Func<double, string> formatter)Sets the formatter used for values in tooltips and labels.
public T ExportButton(bool show = true, string fileName = null)Shows a small download button in the chart's top-right corner (revealed on hover) that saves the chart as a PNG.
public void ExportPng(string fileName = null)Saves the chart as a PNG. CSS-variable colors are resolved to concrete values first, so the exported image matches the theme the chart is currently rendered in.
protected string ColorFor(int index, ChartSeries series)Returns the color for the series at the given index (explicit color or palette by index).
| Overload | |
|---|---|
| Attr(Element, string, double) | Sets an attribute on an SVG element (double values are invariant-formatted). |
| Attr(Element, string, string) | Sets an attribute on an SVG element. |
protected void AttachPointTooltip(Element el, string content)Attaches a hover tooltip to an SVG element: a native <title> child (for accessibility / no-JS fallback) and, when enabled, a tippy popover reusing the bundled tippy.js.
Remarks
The tippy instance is created the first time the point is hovered rather than at render time. A chart is drawn point by point, so building one instance per point up front cost a tippy object, its listeners and a full-document z-index scan for every value in the series — all of it before the user has pointed at anything. One delegated listener on the SVG surface replaces them; the created instance keeps tippy's own trigger from then on, so hover behaviour and the show delay are unchanged.
protected void QueueRender()Schedules a render on the next animation frame, coalescing bursts of changes.
protected abstract void RenderChart(double width, double height)Draws the chart into the SVG surface at the given pixel dimensions.
protected virtual string BuildAriaLabel()Builds the accessibility summary describing the chart's data.
protected void ResetLegendInsets()Clears the space reserved for the legend, before a fresh render measures it again.
| Overload | |
|---|---|
| RenderLegend(double, double) | Renders the legend for the chart's series, recording the space it consumed in the legend insets. |
| RenderLegend(string[], string[], double, double) | Renders a legend of the given labels and colors on the configured edge, recording the space it consumed in _legendInsetTop and friends so the caller can lay the plot out around it. |
RenderLegend(double, double)
protected void RenderLegend(double width, double height)Renders the legend for the chart's series, recording the space it consumed in the legend insets.
Parameters
- width double
- height double
RenderLegend(string[], string[], double, double)
protected void RenderLegend(string[] labels, string[] colors, double width, double height)Renders a legend of the given labels and colors on the configured edge, recording the space it consumed in _legendInsetTop and friends so the caller can lay the plot out around it.
Parameters
- labels string[]
- colors string[]
- width double
- height double
Fields
| Name | Description |
|---|---|
| SvgNs | The SVG namespace used for every chart element. |
| MaxMarkersPerSeries | Above this many points in a series, per-point markers (and their tooltips) are suppressed: one DOM node plus one tooltip per sample stops being readable long before it stops being expensive. Use the spikeline readout instead of markers for dense series. |
| DefaultPalette | The default theme-aware palette (CSS variables that adapt to light/dark mode). |
| _container | The root container element. |
| _svg | The SVG surface that the chart draws into. |
| _series | The chart's series. |
| _palette | The active color palette. |
| _showTooltips | Whether to render per-element tippy + native <title> tooltips. |
| _showLegend | Whether to render the legend. |
| _legendPosition | Where the legend is drawn. |
| _connectGaps | Whether a line/area series draws straight across a NaN gap instead of breaking. |
| _title | An optional caption used as the accessibility summary; falls back to a generated description. |
| _valueFormatter | Optional formatter for values shown in tooltips / axis labels. |
| _plotSurface | The element subclasses draw their series into; clipped to the plot rectangle on cartesian charts. |
| _legendInsetTop | Space the legend claimed at the top of the surface, in pixels. |
| _legendInsetBottom | Space the legend claimed at the bottom of the surface, in pixels. |
| _legendInsetLeft | Space the legend claimed on the left of the surface, in pixels. |
| _legendInsetRight | Space the legend claimed on the right of the surface, in pixels. |
protected const string SvgNs = "http://www.w3.org/2000/svg"The SVG namespace used for every chart element.
protected const int MaxMarkersPerSeries = 300Above this many points in a series, per-point markers (and their tooltips) are suppressed: one DOM node plus one tooltip per sample stops being readable long before it stops being expensive. Use the spikeline readout instead of markers for dense series.
protected static readonly string[] DefaultPalette = { Theme.Colors.Blue600, Theme.Colors.Green600, Theme.Colors.Orange600, Theme.Colors.Purple600, Theme.Colors.Red600, Theme.Colors.Teal600, Theme.Colors.Yellow600, Theme.Colors.Neutral600 }The default theme-aware palette (CSS variables that adapt to light/dark mode).
protected readonly List<ChartSeries> _series = new List<ChartSeries>()The chart's series.
protected bool _showTooltips = trueWhether to render per-element tippy + native <title> tooltips.
protected ChartLegendPosition _legendPosition = ChartLegendPosition.TopWhere the legend is drawn.
protected bool _connectGaps = trueWhether a line/area series draws straight across a NaN gap instead of breaking.
protected string _titleAn optional caption used as the accessibility summary; falls back to a generated description.
protected Func<double, string> _valueFormatter = FormatValueCompactOptional formatter for values shown in tooltips / axis labels.
protected Element _plotSurfaceThe element subclasses draw their series into; clipped to the plot rectangle on cartesian charts.
protected double _legendInsetTopSpace the legend claimed at the top of the surface, in pixels.
protected double _legendInsetBottomSpace the legend claimed at the bottom of the surface, in pixels.
protected double _legendInsetLeftSpace the legend claimed on the left of the surface, in pixels.
public abstract class CartesianChartBase<T> : ChartBase<T> where T : CartesianChartBase<T>Base for cartesian (x/y) charts — line, bar and area. Draws the value (Y) gridlines and labels, the category (X) axis labels, the axis lines, and computes the plot rectangle and value-to-pixel scale that subclasses use to plot their series. Also owns the continuous X scale, tick thinning, zoom/pan and the spikeline readout.
- Namespace
- Tesserae
- Inheritance
- ChartBase<T> → CartesianChartBase<T>
Constructors
| Name | Description |
|---|---|
| CartesianChartBase | Initializes a new instance of the CartesianChartBase{T} class. |
Properties
| Name | Description |
|---|---|
| IsXRangePinned | True when the visible X range came from a zoom / pan rather than fitting the data. |
| DefaultIncludeZeroBaseline | The chart type's default: true when the value axis should always include zero as a baseline. |
| IncludeZeroBaseline | Whether the value axis includes zero, honouring ZeroBaseline over the type default. |
| ConnectsPointsAcrossX | True when the chart draws a continuous line between consecutive points, so a segment crossing the visible window sizes the value axis even with neither of its ends inside it. |
public bool IsXRangePinnedTrue when the visible X range came from a zoom / pan rather than fitting the data.
protected virtual bool DefaultIncludeZeroBaselineThe chart type's default: true when the value axis should always include zero as a baseline.
protected bool IncludeZeroBaselineWhether the value axis includes zero, honouring ZeroBaseline over the type default.
Methods
| Name | Description |
|---|---|
| XAxis | Sets the category labels along the X axis. |
| XValues | Sets shared X positions for every series, putting the chart on a continuous X scale so points sit at their real distance apart instead of being evenly spaced. Per-series positions (XValues) win over these. |
| FormatXAxis | Sets the formatter used for continuous X axis tick labels (and the spikeline readout). |
| XAxisTime | Formats continuous X values as local times, treating them as Unix timestamps in seconds. With no format the labels adapt to the visible span — seconds when zoomed into a minute, dates when showing months — and the ticks land on whole seconds, minutes, hours or days rather than on powers of ten. |
| MaxXTicks | Caps how many X axis tick labels are drawn; categories beyond the cap are skipped evenly. Pass 0 (the default) to derive the cap from the available width, which keeps dense axes readable. |
| XAxisTitle | Sets the X axis title. |
| YAxisTitle | Sets the Y axis title. |
| Grid | Shows or hides the horizontal gridlines. |
| Axes | Shows or hides the axes and their labels. |
| Zoomable | Allows the user to zoom the X axis with the wheel, pan it by dragging, and reset to the full data range by double-clicking. Only meaningful on a continuous X scale. |
| ZoomLimits | Bounds how far the wheel may zoom the X axis, as the smallest and largest visible span. Pass 0 for either to keep the default, which is a fraction (and a multiple) of the data's own X extent. A chart that loads its data to match the visible range wants an explicit maximum: the widest span the user can reach is what decides how much has to be fetched. |
| Spikelines | Draws a vertical spikeline that follows the cursor across the plot, with a readout of the X position and each series' nearest value. The readable alternative to a marker per sample on a dense series. |
| XRange | Pins the visible X range on a continuous scale. Setting the range does not raise OnRangeChanged, so charts can be kept in sync with each other without a re-entrancy guard. |
| AutoRangeX | Returns the chart to fitting the full X extent of its data, undoing any zoom or pan. |
| TryGetXRange | Gets the X range the chart is currently showing. False when the chart has no continuous X data yet. |
| OnRangeChanged | Raised when the user zooms, pans or resets the X axis — not when XRange is called, so a handler that pushes the range onto sibling charts cannot loop. |
| ZeroBaseline | Overrides whether the value axis includes zero, regardless of the chart type's default. An area chart of a metric that hovers far from zero reads better fitted to its data, with the fill still running to the bottom of the plot. |
| PixelY | Maps a value to its pixel Y coordinate within the plot area. |
| PixelXForValue | Maps a continuous X value to its pixel X coordinate within the plot area. |
| XOf | Returns the X position of point index of a series on a continuous scale. |
| SeriesPointX | Returns the pixel X coordinate for point index of series, using the continuous scale when the chart has X values and evenly spaced slots otherwise. |
| SeriesRuns | Splits a series into runs of consecutive plottable points, breaking at NaN gaps. Returns a single run covering every non-gap point when gaps are connected. |
| RenderChart | |
| CollectRangeValues | Collects the values the Y axis must accommodate. Only what is inside the visible X window counts on a continuous scale, so zooming rescales the value axis to what is on screen. |
| FormatXValue | Formats a continuous X value using the configured X formatter, falling back to a plain number. |
| NiceStep | Rounds a rough interval up to the nearest 1, 2 or 5 times a power of ten, which is what makes an axis read as 0 / 200 / 400 rather than 0 / 168.4 / 336.8. Returns 0 for an interval it cannot represent. |
| CategoryCenterX | Returns the pixel X coordinate of the center of category slot index. |
| PointX | Returns the pixel X coordinate for point index of a line/area series. |
| RenderSeries | Plots the series into the computed plot rectangle. |
public T XAxis(params string[] categories)Sets the category labels along the X axis.
public T XValues(double[] values)Sets shared X positions for every series, putting the chart on a continuous X scale so points sit at their real distance apart instead of being evenly spaced. Per-series positions (XValues) win over these.
public T FormatXAxis(Func<double, string> formatter)Sets the formatter used for continuous X axis tick labels (and the spikeline readout).
public T XAxisTime(string format = null)Formats continuous X values as local times, treating them as Unix timestamps in seconds. With no format the labels adapt to the visible span — seconds when zoomed into a minute, dates when showing months — and the ticks land on whole seconds, minutes, hours or days rather than on powers of ten.
public T MaxXTicks(int count)Caps how many X axis tick labels are drawn; categories beyond the cap are skipped evenly. Pass 0 (the default) to derive the cap from the available width, which keeps dense axes readable.
public T Grid(bool show = true)Shows or hides the horizontal gridlines.
public T Axes(bool show = true)Shows or hides the axes and their labels.
public T Zoomable(bool enable = true)Allows the user to zoom the X axis with the wheel, pan it by dragging, and reset to the full data range by double-clicking. Only meaningful on a continuous X scale.
public T ZoomLimits(double minSpan, double maxSpan)Bounds how far the wheel may zoom the X axis, as the smallest and largest visible span. Pass 0 for either to keep the default, which is a fraction (and a multiple) of the data's own X extent. A chart that loads its data to match the visible range wants an explicit maximum: the widest span the user can reach is what decides how much has to be fetched.
public T Spikelines(bool enable = true)Draws a vertical spikeline that follows the cursor across the plot, with a readout of the X position and each series' nearest value. The readable alternative to a marker per sample on a dense series.
public T XRange(double min, double max)Pins the visible X range on a continuous scale. Setting the range does not raise OnRangeChanged, so charts can be kept in sync with each other without a re-entrancy guard.
public T AutoRangeX()Returns the chart to fitting the full X extent of its data, undoing any zoom or pan.
public bool TryGetXRange(out double min, out double max)Gets the X range the chart is currently showing. False when the chart has no continuous X data yet.
public T OnRangeChanged(Action<ChartRange> handler)Raised when the user zooms, pans or resets the X axis — not when XRange is called, so a handler that pushes the range onto sibling charts cannot loop.
public T ZeroBaseline(bool include = true)Overrides whether the value axis includes zero, regardless of the chart type's default. An area chart of a metric that hovers far from zero reads better fitted to its data, with the fill still running to the bottom of the plot.
protected double PixelY(double value)Maps a value to its pixel Y coordinate within the plot area.
protected double PixelXForValue(double x)Maps a continuous X value to its pixel X coordinate within the plot area.
protected double XOf(ChartSeries series, int index)Returns the X position of point index of a series on a continuous scale.
protected double SeriesPointX(ChartSeries series, int index)Returns the pixel X coordinate for point index of series, using the continuous scale when the chart has X values and evenly spaced slots otherwise.
protected List<List<int>> SeriesRuns(ChartSeries series)Splits a series into runs of consecutive plottable points, breaking at NaN gaps. Returns a single run covering every non-gap point when gaps are connected.
protected override void RenderChart(double width, double height)protected virtual void CollectRangeValues(List<double> into)Collects the values the Y axis must accommodate. Only what is inside the visible X window counts on a continuous scale, so zooming rescales the value axis to what is on screen.
protected string FormatXValue(double value)Formats a continuous X value using the configured X formatter, falling back to a plain number.
private static double NiceStep(double rough)Rounds a rough interval up to the nearest 1, 2 or 5 times a power of ten, which is what makes an axis read as 0 / 200 / 400 rather than 0 / 168.4 / 336.8. Returns 0 for an interval it cannot represent.
protected double CategoryCenterX(int index)Returns the pixel X coordinate of the center of category slot index.
protected double PointX(int index)Returns the pixel X coordinate for point index of a line/area series.
Fields
| Name | Description |
|---|---|
| _categories | Category labels along the X axis. |
| _showGrid | Whether to draw horizontal gridlines. |
| _showAxes | Whether to draw the axes and their labels. |
| _xAxisTitle | Optional X axis title. |
| _yAxisTitle | Optional Y axis title. |
| _plotLeft | Left edge of the plot area, in pixels. |
| _plotTop | Top edge of the plot area, in pixels. |
| _plotWidth | Width of the plot area, in pixels. |
| _plotHeight | Height of the plot area, in pixels. |
| _minValue | The minimum value mapped to the bottom of the plot. |
| _maxValue | The maximum value mapped to the top of the plot. |
| _pointCount | The number of categories/points along the X axis. |
| _continuousX | True when the chart plots against a continuous X scale rather than evenly spaced categories. |
| _viewXMin | The lowest visible X value on a continuous scale. |
| _viewXMax | The highest visible X value on a continuous scale. |
protected string[] _categories = new string[0]Category labels along the X axis.
protected bool _showGrid = trueWhether to draw horizontal gridlines.
protected bool _showAxes = trueWhether to draw the axes and their labels.
protected double _minValueThe minimum value mapped to the bottom of the plot.
protected double _maxValueThe maximum value mapped to the top of the plot.
protected int _pointCountThe number of categories/points along the X axis.
protected bool _continuousXTrue when the chart plots against a continuous X scale rather than evenly spaced categories.
protected double _viewXMinThe lowest visible X value on a continuous scale.
public sealed class LineChart : CartesianChartBase<LineChart>A lightweight, dependency-free SVG line chart. Plots one or more series as connected lines with hoverable points, value gridlines, category labels and a theme-aware palette. Fluent and responsive.
- Namespace
- Tesserae
- Inheritance
- CartesianChartBase<LineChart> → LineChart
Constructors
| Name | Description |
|---|---|
| LineChart | Initializes a new instance of the LineChart class. |
Methods
| Name | Description |
|---|---|
| Points | Shows or hides the per-point markers. |
public sealed class BarChart : CartesianChartBase<BarChart>A lightweight, dependency-free SVG bar chart. Renders grouped bars per category (one bar per series) or, with Stacked, one stacked column per category, with a zero baseline, value gridlines, category labels, hover tooltips and a theme-aware palette.
- Namespace
- Tesserae
- Inheritance
- CartesianChartBase<BarChart> → BarChart
Constructors
| Name | Description |
|---|---|
| BarChart | Initializes a new instance of the BarChart class. |
Methods
| Name | Description |
|---|---|
| Rounded | Sets the corner radius of the bars. |
| Stacked | Stacks the series into one column per category instead of drawing them side by side. Positive and negative values stack away from the baseline independently. |
| CollectRangeValues |
public BarChart Stacked(bool stacked = true)Stacks the series into one column per category instead of drawing them side by side. Positive and negative values stack away from the baseline independently.
public sealed class AreaChart : CartesianChartBase<AreaChart>A lightweight, dependency-free SVG area chart. Renders each series as a gradient-filled region under its line (matching Sparkline's fill style), with hoverable points, gridlines and category labels.
- Namespace
- Tesserae
- Inheritance
- CartesianChartBase<AreaChart> → AreaChart
Constructors
| Name | Description |
|---|---|
| AreaChart | Initializes a new instance of the AreaChart class. |
Methods
| Name | Description |
|---|---|
| Points | Shows or hides the per-point markers. |
public sealed class PieChart : ChartBase<PieChart>A lightweight, dependency-free SVG pie / donut chart. Renders the first series' values as slices, labelled by the configured category labels, with hover tooltips, an optional legend and a theme-aware palette.
- Namespace
- Tesserae
- Inheritance
- ChartBase<PieChart> → PieChart
Constructors
| Name | Description |
|---|---|
| PieChart | Initializes a new instance of the PieChart class. |
See also
- [[Sparkline]] — compact inline trend chart, no axes or interactivity
- Component catalog
- Get started