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
info

For handling the actions you can use the Event Bus methods

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: How to access Gantt API