Skip to content

charton API


charton API / @chart-on/ui / index / createChartGrid

Function: createChartGrid() ​

createChartGrid(container, options?): ChartGrid

Defined in: ui/src/grid.ts:210

One to eight chart shells in a grid of resizable cells, with an active cell that the grid toolbar acts on and a link group that keeps the charts in step. Requires @chart-on/ui/style.css.

Parameters ​

container ​

HTMLElement

options? ​

ChartGridOptions = {}

Returns ​

ChartGrid

Example ​

ts
const grid = createChartGrid(el, {
  layout: '2x2',
  setup(shell, index) {
    shell.chart.setDataSource(source);
    void shell.chart.setSymbol(symbols[index]!, '1h');
  },
});
grid.links.applyOptions({ interval: true });