@mui/x-charts
Version:
The community edition of the charts components (MUI X).
13 lines • 461 B
JavaScript
import getBarLegend from '../BarChart/legend';
import getScatterLegend from '../ScatterChart/legend';
import getLineLegend from '../LineChart/legend';
import getPieLegend from '../PieChart/legend';
const legendGetter = {
bar: getBarLegend,
scatter: getScatterLegend,
line: getLineLegend,
pie: getPieLegend
};
export function getSeriesToDisplay(series) {
return Object.keys(series).flatMap(seriesType => legendGetter[seriesType](series[seriesType]));
}