lengthUnit
Description
Optional. Defines the minimal unit for task bars (the task length) in a chartUsage
lengthUnit?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
Parameters
lengthUnit- the minimal unit of the task bars (task length) in a chart. It should be equal to or smaller than thescalesunit. Possible values: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year".
Example
import { useState } from "react";
import { getData } from "./data";
import { Gantt } from "@svar-ui/react-gantt";
const data = getData();
export default function Example() {
const [lengthUnit, setLengthUnit] = useState("week");
return (
<Gantt
tasks={data.tasks}
lengthUnit={lengthUnit}
/>
);
}