Skip to content

API Quick Reference

Chart Types

2D ChartType values: Bar, Line, Point, Area, Pie, Donut, Radar, Bubble, Scatter, HeatMap, Candlestick, Sparkline, MiniBar, MiniPie, MiniDonut, Indicator.

Common Builder Calls

Chart.Create()
Chart.Create<T>(data, item => new BarMark(...))
builder.Add(mark)
builder.ChartType(ChartType.Bar)
builder.Theme(theme)
builder.ChartTitle("Title").ChartSubtitle("Subtitle")
builder.ChartXAxis(axis => axis.Label("X"))
builder.ChartYAxis(axis => axis.Label("Y"))
builder.ChartXScale(min, max).ChartYScale(min, max)
builder.ChartLegend(LegendPosition.Bottom)
builder.ChartScrollableAxes(ScrollableAxes.Horizontal)
builder.ChartXVisibleDomain(length)
builder.ChartForegroundStyleScale(dictionaryOrColorScale)
builder.ChartSymbolScale(dictionary)
builder.ChartSymbolSizeScale(new ClosedRange<float>(4f, 24f))
builder.ShowDataLabels()
builder.Animation(Animation.Default)
builder.NoAnimation()
builder.Build()

Common Runtime Calls

chart.SetValues(values);
chart.SetData(marks);
chart.AddMark(mark);
chart.ClearMarks();
chart.MorphTo(ChartType.Pie);
chart.ClearSelection();

ChartGraphic graphic = ChartCanvasHelper.RenderToRectTransform(chart, rect, true, "Chart");
ChartCanvasHelper.RemoveChart(graphic);

For advanced domain/layout queries, Chart.Specification captures the latest immutable authoring state without layout. Chart.Compile() and Chart.ResolvedSnapshot resolve the current revision and expose data domains, effective domains and plot bounds. HasResolvedSnapshot indicates whether the chart already has a snapshot for its current revision. Continue to create and modify charts through the public builder and chart APIs.