Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/pages/x/api/charts/charts-legend.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"description": "Styles applied to the legend in row layout.",
"isGlobal": false
},
{
"key": "item",
"className": "MuiChartsLegend-item",
"description": "Styles applied to the list item around each series in the legend.",
"isGlobal": false
},
{
"key": "label",
"className": "MuiChartsLegend-label",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the legend in row layout"
},
"item": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the list item around each series in the legend"
},
"label": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the series label" },
"mark": { "description": "Styles applied to {{nodeName}}.", "nodeName": "series mark element" },
"root": { "description": "Styles applied to the root element." },
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsLegend/ChartsLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const ChartsLegend = consumeSlots(
>
{data.items.map((item, i) => {
return (
<li key={item.id}>
<li key={item.id} className={classes?.item}>
<Element
className={classes?.series}
role={onItemClick ? 'button' : undefined}
Expand Down
4 changes: 4 additions & 0 deletions packages/x-charts/src/ChartsLegend/chartsLegendClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import type { ChartsLegendSlotExtension } from './chartsLegend.types';
export interface ChartsLegendClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the list item around each series in the legend. */
item: string;
/** Styles applied to a series element. */
series: string;
/** Styles applied to series mark element. */
Expand All @@ -27,6 +29,7 @@ export const useUtilityClasses = (props: ChartsLegendProps & ChartsLegendSlotExt
const { classes, direction } = props;
const slots = {
root: ['root', direction],
item: ['item'],
mark: ['mark'],
label: ['label'],
series: ['series'],
Expand All @@ -37,6 +40,7 @@ export const useUtilityClasses = (props: ChartsLegendProps & ChartsLegendSlotExt

export const legendClasses: ChartsLegendClasses = generateUtilityClasses('MuiChartsLegend', [
'root',
'item',
'series',
'mark',
'label',
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.