resize-chart
Description
Fires when the chart container size changesUsage
"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 pixelsheight- (required) the current height of the chart container in pixelsscrollSize- (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} />