Documentation / @finchart/core / index / createPlotModel
Function: createPlotModel()
createPlotModel<
T>(options):PlotModel
Defined in: packages/core/src/plot/model.ts:78
A chart with neither a DOM nor a canvas.
The entry point for server rendering, workers, tests, and other surfaces. It builds the same Plot as the browser entry point (browserDeps + PlotBuilder) — the model isn't a separate class, just different wiring, so there's nothing to maintain twice.
// Turn off showGrid — otherwise the grid is drawLine too, so the first line would be a grid line.
const model = createPlotModel({
size,
series: { series: lineSeries(), data },
config: { showGrid: false },
});
const [line] = model.commands().filter((c) => c.type === "drawLine");Default wiring: in-memory layers, a recording renderer, an empty StyleReader (colors fall back to code defaults — for theming, use config.style or deps.createStyleReader), and canvas tick labels (disable with config.axis.showLabels). No text measurer by default — axis width falls back to a fixed value, and an environment that knows font metrics supplies one via deps.createTextMeasurer.
Type Parameters
T
T extends BaseDataPoint = BaseDataPoint