Skip to main content

resize-chart

Description

Fires when the chart container size changes

Usage

"resize-chart": ({
width: number,
height: number,
scrollSize: number,
}) => boolean | void;

Parameters

The callback of the resize-chart action takes an object with the following parameters:

  • width - (required) the current width of the chart container in pixels
  • height - (required) the current height of the chart container in pixels
  • scrollSize - (required) the size of the horizontal scroll area in pixels

Example

<script>
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/svelte-gantt";

const data = getData();

function init(api) {
api.on("resize-chart", ev => {
console.log("The chart container was resized", ev);
});
}
</script>

<Gantt
tasks={data.tasks}
{init} />