UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

38 lines 803 B
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 ChartsGridHorizontal(props) { const { axis, start, end, classes } = props; const { scale, tickNumber, tickInterval } = axis; const yTicks = useTicks({ scale, tickNumber, tickInterval, direction: 'y' }); return /*#__PURE__*/_jsx(React.Fragment, { children: yTicks.map(({ value, offset }) => /*#__PURE__*/_jsx(GridLine, { y1: offset, y2: offset, x1: start, x2: end, className: classes.horizontalLine }, `horizontal-${value?.getTime?.() ?? value}`)) }); }