UNPKG

@mui/x-charts

Version:

The community edition of the Charts components (MUI X).

97 lines 3.14 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["drawingArea", "seriesToDisplay"]; import * as React from 'react'; import PropTypes from 'prop-types'; import { LegendPerItem } from './LegendPerItem'; import { jsx as _jsx } from "react/jsx-runtime"; function DefaultChartsLegend(props) { const { seriesToDisplay } = props, other = _objectWithoutPropertiesLoose(props, _excluded); return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, { itemsToDisplay: seriesToDisplay })); } process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "pnpm proptypes" | // ---------------------------------------------------------------------- /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * The direction of the legend layout. * The default depends on the chart. */ direction: PropTypes.oneOf(['column', 'row']).isRequired, /** * @deprecated Use the `useDrawingArea` hook instead. */ drawingArea: PropTypes.shape({ bottom: PropTypes.number.isRequired, height: PropTypes.number.isRequired, left: PropTypes.number.isRequired, right: PropTypes.number.isRequired, top: PropTypes.number.isRequired, width: PropTypes.number.isRequired }).isRequired, /** * Set to true to hide the legend. * @default false */ hidden: PropTypes.bool, /** * Space between two legend items (in px). * @default 10 */ itemGap: PropTypes.number, /** * Height of the item mark (in px). * @default 20 */ itemMarkHeight: PropTypes.number, /** * Width of the item mark (in px). * @default 20 */ itemMarkWidth: PropTypes.number, /** * Style applied to legend labels. * @default theme.typography.subtitle1 */ labelStyle: PropTypes.object, /** * Space between the mark and the label (in px). * @default 5 */ markGap: PropTypes.number, /** * Legend padding (in px). * Can either be a single number, or an object with top, left, bottom, right properties. * @default 10 */ padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ bottom: PropTypes.number, left: PropTypes.number, right: PropTypes.number, top: PropTypes.number })]), /** * The position of the legend. */ position: PropTypes.shape({ horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired, vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired }).isRequired, series: PropTypes.object.isRequired, seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({ color: PropTypes.string.isRequired, id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, label: PropTypes.string.isRequired })).isRequired } : void 0; export { DefaultChartsLegend };