UNPKG

@mui/x-charts

Version:

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

15 lines 485 B
import getBarLegend from '../BarChart/legend'; import getScatterLegend from '../ScatterChart/legend'; import getLineLegend from '../LineChart/legend'; import getPieLegend from '../PieChart/legend'; var legendGetter = { bar: getBarLegend, scatter: getScatterLegend, line: getLineLegend, pie: getPieLegend }; export function getSeriesToDisplay(series) { return Object.keys(series).flatMap(function (seriesType) { return legendGetter[seriesType](series[seriesType]); }); }