lengthUnit
Description
Defines the minimal unit for task bars (the task length) in a chartUsage
lengthUnit?: "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 thescales
unit. Possible values: "hour" | "day" | "week" | "month" | "quarter" | "year".
Example
import { getData } from "./data";
import { Gantt } from "wx-react-gantt";
import "wx-react-gantt/dist/gantt.css";
import { useRef } from "react";
function GanttComponent() {
const data = getData();
const lengthUnitRef = useRef("week");
return (
<Gantt
tasks={data.tasks}
lengthUnit={lengthUnitRef.current}
/>
);
}
export default GanttComponent;