@mui/x-charts
Version:
The community edition of MUI X Charts components.
38 lines • 797 B
JavaScript
import * as React from 'react';
import { useTicks } from "../hooks/useTicks.js";
import { GridLine } from "./styledComponents.js";
import { jsx as _jsx } from "react/jsx-runtime";
/**
* @ignore - internal component.
*/
export function ChartsGridVertical(props) {
const {
axis,
start,
end,
classes
} = props;
const {
scale,
tickNumber,
tickInterval
} = axis;
const xTicks = useTicks({
scale,
tickNumber,
tickInterval,
direction: 'x'
});
return /*#__PURE__*/_jsx(React.Fragment, {
children: xTicks.map(({
value,
offset
}) => /*#__PURE__*/_jsx(GridLine, {
y1: start,
y2: end,
x1: offset,
x2: offset,
className: classes.verticalLine
}, `vertical-${value?.getTime?.() ?? value}`))
});
}