scroll-chart
Description
Fires when a chart is scrolledUsage
"scroll-chart": ({
left?: number,
top?: number
}) => boolean | void;
Parameters
The callback of the scroll-chart event can take an object with the following parameters:
left- (optional) specifies the number of pixels the chart is scrolled to the lefttop- (optional) specifies the number of pixels the chart is scrolled to the top
info
For handling the events you can use the Event Bus methods
Example
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/react-gantt";
const data = getData();
function init(api) {
api.on("scroll-chart", ev => {
console.log("The chart is scrolled");
});
}
export default function App() {
return <Gantt tasks={data.tasks} init={init} />;
}
Related articles: How to access Gantt API