Skip to main content

scroll-chart

Description

Fires when a chart is scrolled

Usage

"scroll-chart": ({
left?: number,
top?: number
}) => boolean | void;

Parameters

The callback of the scroll-chart action can take an object with the following parameters:

  • left - (optional) specifies the number of pixels the chart is scrolled to the left
  • top - (optional) specifies the number of pixels the chart is scrolled to the top

Example

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

const data = getData();

let api;

$: if (api) {
api.on("scroll-chart", ev => {
console.log("The chart is scrolled");
});
}

</script>

<Gantt
bind:api
tasks={data.tasks}
//other settings />

Related articles: