Meziantou.Framework.Charts namespace

Classes

NameDescription
AfmTextMeasurerMeasures text with the metrics of Helvetica and Helvetica-Bold, the standard fonts of PDF, without any font file or system font: the measurement is the same on every machine.
AnnotationMark<T>Draws an annotation per row: a text placed at an offset from a point of the chart, and an arrow from the text to the point. The text is anchored on the side of the offset, so it stays clear of the point; a line break starts a new line.
ArcMark<T>Draws a slice per row: a pie or a donut (with PolarCoordinates.InnerRadius), whose slices have angles proportional to the values. With ArcMark<T>.Radius, the slices have equal angles and radii from the values: a polar area (rose) chart. The plot uses polar coordinates, unless it sets other coordinates.
AreaMark<T>Fills the area between a line through the rows and a baseline, one area per series (the AreaMark<T>.Series channel, else Mark<T>.Fill). The baseline is AreaMark<T>.Y1, else zero. With a StackTransform, the areas are stacked; with StackOffset.Silhouette, they make a streamgraph.
AxisThe options of the axis of a position scale.
BandScaleA scale of categories that divides the axis into bands of equal width, such as the bars of a bar chart.
BarMark<T>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).
BinTransformGroups the x values of the rows into bins and counts them: a histogram when used with a RectMark<T>. Each bin becomes a row with X1 and X2 its edges, Y1 zero and Y2 its count. The rows are binned separately for each value of the Fill channel.
BoxMark<T>Draws a box plot per category of x: a box from the first to the third quartile, a line at the median, whiskers to the most extreme values within 1.5 times the interquartile range, and the outliers as dots (see BoxStatistics).
BoxStatisticsThe statistics of box plots: quantiles with linear interpolation (R's type 7, the default of R, NumPy and Excel) and Tukey's whiskers.
BoxSummaryThe five-number summary of a sample, with its outliers, as a box plot draws it.
CandlestickMark<T>Draws a candlestick per row (OHLC prices): a line from the low to the high price, and a box from the open to the close price, in the positive color of the theme when the price rises and in its negative color when it falls.
CartesianCoordinatesCartesian coordinates: x is horizontal, from left to right, and y is vertical, from bottom to top.
ChartSceneA chart laid out into drawing primitives, independent of the output format. Plot.CreateScene creates it; SvgChartRenderer and the renderer of Meziantou.Framework.Imaging.Charts draw it.
ChartThemeThe colors, fonts and stroke widths of a chart.
ChordMark<T>Draws a chord diagram of the flows between nodes, with a row per flow: the nodes are arcs around a circle, as long as the total of the flows that leave them, and each pair of nodes is joined by a ribbon whose ends are as wide as the flows from each node to the other. The nodes take the colors of the palette of the theme, and a ribbon takes the color of the node of its larger flow, unless the Mark<T>.Fill channel colors the ribbons.
ClusterLayoutLays a tree out as a dendrogram, as d3's cluster: the leaves are evenly spaced at the deepest level, and each parent is centered over its children. Siblings are 1 unit apart, cousins 2.
ColorScaleMaps the values of the Fill and Stroke channels to colors. When a plot has no color scale, it uses an OrdinalColorScale for categories and a SequentialColorScale for numbers.
ColorSchemeA continuous color ramp, interpolated in the OKLab color space between evenly spaced stops.
ContinuousScaleA scale of continuous values: numbers or times.
ContourMark<T>Draws the density contours of points: the two-dimensional density of the points, estimated with a Gaussian kernel on a grid, is cut at round thresholds with marching squares, and the region above each threshold is filled (or outlined) with the color of the threshold, mapped by the color scale (a sequential scale by default).
CoordinatesHow the positions of the x and y scales become points of the chart.
CumulativeTransformReplaces the y values with running totals, in the order of the rows, for each series: each row goes from the total before it (Y1) to the total after it (Y2). It is the transform of waterfall charts.
DensityTransformEstimates the probability density of the x values with a Gaussian kernel, for each series (the Series channel, else the colors). Each series becomes rows of evenly spaced x values, with their density as y. Draw it with an AreaMark<T> or a LineMark<T>: a density plot. The y channel of the mark is ignored.
DivergingColorScaleMaps numbers to the colors of a diverging ramp: the middle of the ramp is DivergingColorScale.Midpoint, and each half covers one side of it.
DotMark<T>Draws a dot per row at its x and y positions: a scatter plot, or a bubble chart with the DotMark<T>.Size channel.
FacetOptionsThe options of the grid of small charts of a plot whose marks have facets (Mark<T>.FacetX, Mark<T>.FacetY).
FontFaceTextMeasurerMeasures text by shaping it with a font of Meziantou.Framework.Fonts: every script, ligatures, kerning and the advances of the font are taken into account.
FunnelMark<T>Draws a funnel: a centered bar per stage, from the top down, whose width is proportional to its value, joined to the next stage by a lighter trapezoid. Each bar shows its value, and the y axis shows the stages.
GeoCoordinatesGeographic coordinates: the x scale gives the longitude and the y scale the latitude, in degrees, and a GeoProjection places them on the map, scaled and centered to fit the plot area. Every mark can draw on a map: a DotMark<T> places its dots at their longitudes and latitudes.
GeoMark<T>Draws a geometry per row on a map: its polygons are filled (a choropleth when the Mark<T>.Fill channel is mapped by the color scale), its lines are stroked and its points are dots. The plot uses GeoCoordinates by default when it has a geo mark.
GroupTransformCombines the rows that share an x value and a series into one row, whose y value is reduced from theirs (sum, mean, count...). The other channels come from the first row of the group.
HexbinMark<T>Draws a hexbin plot: the plot area is tiled with hexagons, and each hexagon that has points is colored by the number of its points with the color scale (a sequential scale by default). It shows the density of a scatter plot with too many points to draw each one.
HierarchyCreates trees of HierarchyNode<T> from nested objects, from rows with a parent identifier, or from paths.
HierarchyCircle<T>A node of a tree placed by a PackLayout.
HierarchyMark<T>A mark that draws the nodes of a tree in the plot area, without position scales. The nodes are colored by the color scale.
HierarchyNode<T>A node of a tree, for the hierarchical charts (PackMark<T>, TreemapMark<T>, PartitionMark<T>). Create a tree with Hierarchy.
HierarchyPoint<T>A node of a tree placed by a TreeLayout or a ClusterLayout.
HierarchyRectangle<T>A node of a tree placed by a TreemapLayout or a PartitionLayout.
LegendThe options of the legend of the color scale.
LineMark<T>Draws a line through the rows, one line per series (the LineMark<T>.Series channel, else the Mark<T>.Stroke channel). A missing value breaks the line. In polar coordinates with LineMark<T>.Closed, it draws the outline of a radar chart.
LinearGradientPaintA linear gradient, between two points in the coordinates of the shape it paints.
LinearScaleA scale that maps numbers proportionally to positions.
LogScaleA logarithmic scale. Values that are zero or negative are not drawn.
MarkA layer of a Plot that draws its data with shapes: bars, lines, dots, arcs... The positions, colors and sizes of the shapes are channels, mapped by the scales of the plot.
Mark<T>A mark that draws a sequence of rows of type T, one shape (or one point of a line) per row.
NetworkMark<T>Draws a network graph (a node-link diagram) with a row per link: the nodes are placed by the force-directed layout of d3-force, where the links are springs and the nodes repel each other, then the drawing is fitted to the plot area. The layout is deterministic: it runs a fixed number of ticks from fixed starting positions.
NumberFormatsNumber formats for the tick labels of the scales (ContinuousScale.TickFormat). They use the invariant culture.
OrdinalColorScaleGives each category a color of a palette, in order.
PackLayoutLays a tree out as nested circles: the area of each leaf is proportional to its value, and the children of a node are packed in its circle, as d3's pack. The result is deterministic.
PackMark<T>Draws a tree as packed circles (PackLayout): each leaf is a circle whose area is proportional to its value, inside the circles of its ancestors.
ParallelCoordinatesMark<T>Draws a parallel coordinates plot: a vertical axis per dimension, evenly spaced across the plot area, each with its own scale, and a line per row through its values on the axes. The Mark<T>.Stroke channel colors the lines.
ParallelDimension<T>An axis of a ParallelCoordinatesMark<T>: a channel of the rows and its own scale.
PartitionLayoutLays a tree out as adjacent rectangles, one layer per depth, as d3's partition: an icicle chart, or a sunburst once mapped to polar coordinates. The width of a node is proportional to its value.
PartitionMark<T>Draws a tree as adjacent layers, one per depth (PartitionLayout): an icicle chart in Cartesian coordinates (horizontal layers from the top down, or vertical layers from the left when transposed), and a sunburst in polar coordinates (rings from the center out). The size of a node along its layer is proportional to its value.
PathBuilderBuilds a PathData.
PathDataThe geometry of a ScenePath: a list of commands, as in SVG.
PlotA chart, described with the grammar of graphics: layers of marks (bars, lines, dots, arcs...) whose channels are mapped by scales (x, y, color, size) and placed by coordinates (Cartesian or polar).
PointScaleA scale of categories that places them at evenly spaced points, such as the axes of a radar chart.
PolarCoordinatesPolar coordinates: the x scale gives the angle and the y scale gives the radius (swapped when Coordinates.Transposed). Angles are in degrees, clockwise, from 12 o'clock.
PowScaleA power scale: the position is proportional to the value raised to PowScale.Exponent, keeping its sign.
RectMark<T>Draws a rectangle per row. On each axis, the rectangle covers the band of a category (RectMark<T>.X, RectMark<T>.Y), the interval between two values (RectMark<T>.X1 and RectMark<T>.X2, RectMark<T>.Y1 and RectMark<T>.Y2), or the whole plot area when no channel is set. Two band axes and a numeric fill make a heatmap; a BinTransform on x makes a histogram.
RegressionFits polynomials to points by ordinary least squares, for trend lines (RegressionTransform).
RegressionResultA polynomial fitted by least squares: y = c0 + c1 x + c2 x² + ...
RegressionTransformReplaces the rows of each series (the Series channel, else the colors) with the points of a polynomial fitted to them by least squares (Regression), across the range of their x values: a trend line when used with a LineMark<T>. The tooltip of each line is its equation. A series with too few points is not drawn.
RidgelineMark<T>Draws a ridgeline plot (a joy plot): the probability density of the x values of each category of y, estimated with a Gaussian kernel, as an area that rises from the position of the category. The areas overlap the categories above them: the tallest one is RidgelineMark<T>.Overlap times the space between two categories, and the others are scaled with it, so their heights compare. The categories are drawn from the top down, each one in front of the previous one.
RuleXMarkDraws vertical reference lines at x values, across the plot area.
RuleXMark<T>Draws a line at the x value of each row, across the plot area, across the band of the category RuleXMark<T>.Y, or from RuleXMark<T>.Y1 to RuleXMark<T>.Y2: vertical reference lines, the stems of lollipops, error bars. In polar coordinates, the lines go out from the center (the needle of a gauge).
RuleYMarkDraws horizontal reference lines at y values, across the plot area, such as a baseline at zero or a threshold.
RuleYMark<T>Draws a line at the y value of each row, across the plot area, across the band of the category RuleYMark<T>.X, or from RuleYMark<T>.X1 to RuleYMark<T>.X2: horizontal reference lines and thresholds, the targets of bullet charts, the bars of dumbbells. In polar coordinates, the lines are circles.
SankeyMark<T>Draws a Sankey diagram of the flows between nodes, with a row per link: the nodes are bars in columns whose heights are their values, and the links are bands whose widths are their values. The nodes take the colors of the palette of the theme, and a link takes the color of its source, unless the Mark<T>.Fill channel colors the links.
ScaleMaps the values of a position channel (x or y) to positions. When a plot has no scale for a channel, it infers one from the values of its marks.
SceneCircleA circle.
SceneElementAn element of a ChartScene.
SceneGroupA group of elements, with a transform, a clip rectangle and an opacity that apply to all of them.
SceneLineA straight line segment.
ScenePaintHow a shape is painted.
ScenePathA path of lines, curves and arcs.
SceneRectangleAn axis-aligned rectangle.
SceneShapeAn element that is filled or stroked.
SceneTextA line of text, positioned by its baseline.
SequentialColorScaleMaps numbers to the colors of a ramp, from its start for the smallest value to its end for the largest.
SizeLegendThe options of the legend of the size scale: nested circles of a few values, next to the legend of the color scale and at its Legend.Position.
SizeScaleMaps the values of the Size channel to radii, so the area of a dot is proportional to its value (a square-root scale from 0).
SolidPaintA paint of a single color.
SqrtScaleA square-root scale: a power scale of exponent 0.5.
StackTransformStacks the y values of the rows that share an x value (or an X1 value, for rectangles), one series above the other. The series of a row is given by the Series channel of the mark, else its Fill or Stroke channel. Bars become stacked bars and areas become stacked areas.
SvgChartRendererWrites a ChartScene as SVG.
SvgRenderOptionsThe options of SvgChartRenderer.
SymlogScaleA bi-symmetric log scale (Webber 2012): logarithmic for large values, linear near zero, and defined for negative values and zero.
TextMark<T>Draws a text per row at its x and y positions. A position without a channel is the middle of the plot area (the center, in polar coordinates), which places a label in the middle of a donut or a gauge.
TickMark<T>Draws a short line at the x value of each row, across the band of its y category (or across the plot area): a strip plot or a barcode plot.
TimeScaleA scale of times, in UTC. Its ticks fall on calendar boundaries (seconds, minutes, hours, days, weeks, months, years), and each label shows the largest unit the tick does not fall on: 2024, Mar, Mar 15, 06:00.
TransformDerives the rows a mark draws from its data: stacking, binning, grouping...
TreeLayoutLays a tree out as a tidy node-link diagram, as d3's tree: the Reingold–Tilford algorithm in the linear-time version of Buchheim, Jünger and Leipert (2002). The nodes of a depth are on a line, a parent is centered over its children, and subtrees are as compact as possible without overlapping. Siblings are 1 unit apart, cousins 2.
TreeMark<T>Draws a tree as a node-link diagram: a dot per node and a curve from each node to its children. In Cartesian coordinates the root is at the top; transposed, it is on the left; in polar coordinates, it is at the center (a radial tree). The labels of the leaves are drawn after them, and the labels of the other nodes next to them, except in polar coordinates.
TreemapLayoutLays a tree out as nested rectangles whose areas are proportional to the values of the nodes, as d3's treemap.
TreemapMark<T>Draws a tree as a treemap (TreemapLayout): each leaf is a rectangle whose area is proportional to its value, inside the rectangles of its ancestors.
ViolinMark<T>Draws a violin plot per category of x: the probability density of the y values, mirrored on both sides of the middle of the band, from the smallest value to the largest. A thin box from the first to the third quartile and a dot at the median are drawn inside, unless ViolinMark<T>.ShowBox is off. The widths of the violins are proportional to their densities: the widest point of all the violins fills ViolinMark<T>.ViolinWidth of the band.
WaterfallMark<T>Draws a waterfall chart: each bar goes from the running total before its row to the running total after it, in the positive color of the theme for an increase and in its negative color for a decrease. A total row (WaterfallMark<T>.IsTotal) goes from zero to the running total, in the neutral color. Dashed lines join the bars.
WindowTransformReplaces the y value of each row with a reduction (a mean, by default) of the y values of the rows around it, in the order of the rows, for each series: a moving average. At the ends of a series, the window has fewer rows.

Structs

NameDescription
ChartColorAn sRGB color with an alpha channel, 8 bits per channel.
ChartFontThe size and the weight of a text of a chart. The family is the one of the chart (ChartScene.FontFamily).
ChartMarginThe space between the edges of a chart and its plot area.
ChartRectangleA rectangle.
PathCommandA command of a PathData. The fields that do not apply to its kind are 0.
SceneGradientStopA color stop of a gradient.
SceneTransformAn affine transform: a point (x, y) becomes (A x + C y + E, B x + D y + F).
TextMetricsThe dimensions of a line of text.

Interfaces

NameDescription
ITextMeasurerMeasures text, so the layout of a chart (margins, label rotation, truncation, legend wrapping) fits the font that draws it.

Enums

NameDescription
BinThresholdsThe rule that chooses the number of bins of a BinTransform.
CurveHow the points of a line or an area are joined.
DotSymbolThe shape of the dots of a DotMark<T>. The shapes have about the same area for a radius.
GroupReducerHow a GroupTransform combines the y values of a group.
LegendPositionWhere the legend of a chart is drawn.
PathCommandKindThe kind of a PathCommand.
PolarGridShapeThe shape of the grid lines of the radial scale of polar coordinates.
SankeyAlignmentHow the nodes of a SankeyMark<T> are placed in columns.
SceneFillRuleWhich regions of a path with crossing or nested contours are inside.
SceneLineCapThe shape of the ends of an open outline.
SceneLineJoinThe shape of the corners of an outline.
SceneTextAnchorWhere a text is anchored horizontally, relative to its position.
StackOffsetWhere the stacks of a StackTransform start.
StackOrderThe order of the series of a StackTransform, from the bottom of the stacks to their top.
TreeLayoutKindThe layout of a TreeMark<T>.
TreemapTilingHow a TreemapLayout divides the rectangle of a node among its children.
WindowAnchorWhere the window of a WindowTransform is, relative to its row.