@@ -41,6 +41,7 @@ import { HeatmapTooltip, HeatmapTooltipProps } from './HeatmapTooltip';
41
41
import { HeatmapItemSlotProps , HeatmapItemSlots } from './HeatmapItem' ;
42
42
import { HEATMAP_PLUGINS , HeatmapPluginsSignatures } from './Heatmap.plugins' ;
43
43
import { ChartDataProviderPro } from '../ChartDataProviderPro' ;
44
+ import { ChartsToolbarPro } from '../ChartsToolbarPro' ;
44
45
45
46
export interface HeatmapSlots
46
47
extends ChartsAxisSlots ,
@@ -103,6 +104,11 @@ export interface HeatmapProps
103
104
* @default true
104
105
*/
105
106
hideLegend ?: boolean ;
107
+ /**
108
+ * If true, shows the default chart toolbar.
109
+ * @default false
110
+ */
111
+ showToolbar ?: boolean ;
106
112
/**
107
113
* Overridable component slots.
108
114
* @default {}
@@ -168,6 +174,7 @@ const Heatmap = React.forwardRef(function Heatmap(
168
174
highlightedItem,
169
175
onHighlightChange,
170
176
hideLegend = true ,
177
+ showToolbar = false ,
171
178
} = props ;
172
179
173
180
const id = useId ( ) ;
@@ -216,6 +223,7 @@ const Heatmap = React.forwardRef(function Heatmap(
216
223
legendDirection : props . slotProps ?. legend ?. direction ,
217
224
} ;
218
225
const Tooltip = slots ?. tooltip ?? HeatmapTooltip ;
226
+ const Toolbar = slots ?. toolbar ?? ChartsToolbarPro ;
219
227
220
228
return (
221
229
< ChartDataProviderPro < 'heatmap' , HeatmapPluginsSignatures >
@@ -240,6 +248,7 @@ const Heatmap = React.forwardRef(function Heatmap(
240
248
plugins = { HEATMAP_PLUGINS }
241
249
>
242
250
< ChartsWrapper { ...chartsWrapperProps } >
251
+ { showToolbar ? < Toolbar { ...props . slotProps ?. toolbar } /> : null }
243
252
{ ! hideLegend && (
244
253
< ChartsLegend
245
254
slots = { { ...slots , legend : slots ?. legend ?? ContinuousColorLegend } }
@@ -359,6 +368,11 @@ Heatmap.propTypes = {
359
368
* @ignore Unstable props for internal usage.
360
369
*/
361
370
seriesConfig : PropTypes . object ,
371
+ /**
372
+ * If true, shows the default chart toolbar.
373
+ * @default false
374
+ */
375
+ showToolbar : PropTypes . bool ,
362
376
/**
363
377
* The props used for each component slot.
364
378
* @default {}
0 commit comments