Skip to content

Commit 3dea8da

Browse files
committed
feedback
1 parent 229c1ad commit 3dea8da

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

docs/data/charts/heatmap/HeatmapLegend.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export default function HeatmapLegend() {
1515
slotProps={{
1616
legend: {
1717
direction: 'vertical',
18-
sx: { alignSelf: 'stretch', maxHeight: 200 },
18+
position: { vertical: 'middle' },
19+
sx: { height: 200 },
1920
},
2021
}}
2122
/>

docs/data/charts/heatmap/heatmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { HeatmapTooltip, HeatmapTooltipContent } from '@mui/x-charts/Heatmap',
8181

8282
### Legend
8383

84-
The Heatmap comes with a legend which is by default the [ContinuouseColorLegend](/x/react-charts/legend/#color-legend).
84+
The Heatmap comes with a legend which is by default the [ContinuousColorLegend](/x/react-charts/legend/#color-legend).
8585

8686
To display it set `hideLegend` to `false`.
8787
You can modify it with `slots.legend` and `slotProps.legend`.

packages/x-charts-pro/src/Heatmap/Heatmap.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ const Heatmap = React.forwardRef(function Heatmap(
231231
<ChartsWrapper {...chartsWrapperProps}>
232232
{!hideLegend && (
233233
<ChartsLegend
234-
slots={{ legend: slots?.legend ?? ContinuousColorLegend }}
234+
slots={{ ...slots, legend: slots?.legend ?? ContinuousColorLegend }}
235235
slotProps={{ legend: { labelPosition: 'extremes', ...slotProps?.legend } }}
236-
sx={{ alignSelf: 'stretch' }}
236+
sx={slotProps?.legend?.direction === 'vertical' ? { height: 150 } : { width: '50%' }}
237237
/>
238238
)}
239239
<ChartsSurface ref={ref} sx={sx}>

0 commit comments

Comments
 (0)