Plot Class
A 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).
public sealed class PlotRemarks
Every chart type is a combination of these pieces. The scales, the axes and the legend are inferred from the marks unless they are set. Plot.CreateScene lays the chart out into a ChartScene; Plot.ToSvg writes it as SVG. The output is deterministic: the same plot always gives the same SVG.
Constructors
| Name | Description |
|---|---|
| Plot() |
Plot()
Plot.cspublic Plot()No documentation is available.
Properties
| Name | Description |
|---|---|
| Clip | Gets or sets a value that indicates whether the marks are clipped to the plot area. Use it with a domain narrower than the data. |
| ColorScale | Gets or sets the color scale, or null to infer it from the marks. |
| Coordinates | Gets or sets the coordinates, or null for the default: polar for arcs (pies, donuts, gauges), Cartesian otherwise. |
| Description | Gets or sets the accessible description of the chart (an SVG desc). It is not drawn. |
| Facets | Gets the options of the grid of small charts, when marks have facets (Mark<T>.FacetX, Mark<T>.FacetY). |
| Height | Gets or sets the height of the chart, in pixels. The default is 400. |
| Legend | Gets the options of the legend of the color scale. |
| Margin | Gets or sets the space around the plot area, or null to compute it from the axes, the title and the legend. |
| Marks | Gets the marks, drawn in order: the first one is at the bottom. |
| SecondaryYAxis | Gets the options of the axis of the secondary y scale. It has no grid lines by default. |
| SecondaryYScale | Gets or sets the secondary y scale, used by the marks that set Mark.UseSecondaryYScale, or null to infer it from them. In Cartesian coordinates, its axis is on the right of the chart; in transposed and polar coordinates, it has no axis. |
| SizeLegend | Gets the options of the legend of the size scale, drawn next to the legend of the color scale. |
| SizeScale | Gets or sets the size scale, or null for the default. |
| Subtitle | Gets or sets the subtitle, drawn under the title. |
| TextMeasurer | Gets or sets the measurer of the texts, or null for AfmTextMeasurer.Default. |
| Theme | Gets or sets the theme. The default is ChartTheme.Light. |
| Title | Gets or sets the title, drawn at the top of the chart and used as its accessible name. |
| Width | Gets or sets the width of the chart, in pixels. The default is 640. |
| XAxis | Gets the options of the axis of the x scale. |
| XScale | Gets or sets the x scale, or null to infer it from the marks. |
| YAxis | Gets the options of the axis of the y scale. |
| YScale | Gets or sets the y scale, or null to infer it from the marks. |
Clip
Plot.csColorScale
Plot.csGets or sets the color scale, or null to infer it from the marks.
public ColorScale? ColorScale { get; set; }Property value
Coordinates
Plot.csGets or sets the coordinates, or null for the default: polar for arcs (pies, donuts, gauges), Cartesian otherwise.
public Coordinates? Coordinates { get; set; }Property value
Description
Plot.csFacets
Plot.csGets the options of the grid of small charts, when marks have facets (Mark<T>.FacetX, Mark<T>.FacetY).
public FacetOptions Facets { get; }Property value
Height
Plot.csGets or sets the height of the chart, in pixels. The default is 400.
public double Height { get; set; }Legend
Plot.csMargin
Plot.csGets or sets the space around the plot area, or null to compute it from the axes, the title and the legend.
public ChartMargin? Margin { get; set; }Property value
Marks
Plot.csGets the marks, drawn in order: the first one is at the bottom.
Property value
SecondaryYAxis
Plot.csSecondaryYScale
Plot.csGets or sets the secondary y scale, used by the marks that set Mark.UseSecondaryYScale, or null to infer it from them. In Cartesian coordinates, its axis is on the right of the chart; in transposed and polar coordinates, it has no axis.
public Scale? SecondaryYScale { get; set; }Property value
SizeLegend
Plot.csGets the options of the legend of the size scale, drawn next to the legend of the color scale.
public SizeLegend SizeLegend { get; }Property value
SizeScale
Plot.csGets or sets the size scale, or null for the default.
public SizeScale? SizeScale { get; set; }Property value
Subtitle
Plot.csTextMeasurer
Plot.csGets or sets the measurer of the texts, or null for AfmTextMeasurer.Default.
public ITextMeasurer? TextMeasurer { get; set; }Property value
Theme
Plot.csGets or sets the theme. The default is ChartTheme.Light.
public ChartTheme Theme { get; set; }Property value
Title
Plot.csWidth
Plot.csGets or sets the width of the chart, in pixels. The default is 640.
public double Width { get; set; }XAxis
Plot.csXScale
Plot.csYAxis
Plot.csYScale
Plot.csMethods
| Name | Description |
|---|---|
| Add(Mark) | Adds a mark. |
| CreateScene(ITextMeasurer?) | Lays the chart out into drawing primitives. |
| ToSvg(SvgRenderOptions?) | Returns the chart as SVG. |
| WriteSvg(Stream, SvgRenderOptions?) | Writes the chart as SVG, encoded in UTF-8 without a byte order mark. |
| WriteSvg(TextWriter, SvgRenderOptions?) | Writes the chart as SVG. |
Add(Mark)
Plot.csCreateScene(ITextMeasurer?)
Plot.csLays the chart out into drawing primitives.
public ChartScene CreateScene(ITextMeasurer? textMeasurer = null)Parameters
textMeasurerITextMeasurer?- The measurer of the texts, or
nullforPlot.TextMeasurer.
Returns
ChartScene The scene.
ToSvg(SvgRenderOptions?)
Plot.csReturns the chart as SVG.
public string ToSvg(SvgRenderOptions? options = null)Parameters
optionsSvgRenderOptions?- The options, or
nullfor the defaults.
Returns
string The SVG document, without an XML declaration.
WriteSvg overloads
WriteSvg(Stream, SvgRenderOptions?)
Plot.csWrites the chart as SVG, encoded in UTF-8 without a byte order mark.
public void WriteSvg(Stream stream, SvgRenderOptions? options = null)Parameters
streamStream- The destination. It is left open.
optionsSvgRenderOptions?- The options, or
nullfor the defaults.
WriteSvg(TextWriter, SvgRenderOptions?)
Plot.csWrites the chart as SVG.
public void WriteSvg(TextWriter writer, SvgRenderOptions? options = null)Parameters
writerTextWriter- The destination.
optionsSvgRenderOptions?- The options, or
nullfor the defaults.