@@ -64,47 +64,55 @@ const ResetZoomButton = React.forwardRef<HTMLButtonElement, React.PropsWithChild
6464
6565function CustomToolbar ( ) {
6666 return (
67- < Toolbar >
67+ < Stack
68+ width = "100%"
69+ direction = "row"
70+ alignItems = "center"
71+ justifyContent = "space-between"
72+ gap = { 1 }
73+ flexWrap = "wrap"
74+ >
6875 < Typography
69- flexGrow = { 1 }
70- flexShrink = { 0 }
7176 justifyContent = "center"
7277 sx = { { textAlign : { xs : 'center' , sm : 'left' } } }
78+ variant = "h6"
7379 >
7480 Chart with Custom Toolbar
7581 </ Typography >
76- < Stack direction = "row" flex = { 1 } justifyContent = { { xs : 'center' , sm : 'end' } } >
77- < Tooltip title = "Zoom in" >
78- < ChartsToolbarZoomInTrigger render = { < ToolbarButton /> } >
79- < ZoomInIcon />
80- </ ChartsToolbarZoomInTrigger >
81- </ Tooltip >
82- < Tooltip title = "Zoom out" >
83- < ChartsToolbarZoomOutTrigger render = { < ToolbarButton /> } >
84- < ZoomOutIcon />
85- </ ChartsToolbarZoomOutTrigger >
86- </ Tooltip >
82+ < Stack >
83+ < Toolbar >
84+ < Tooltip title = "Zoom in" >
85+ < ChartsToolbarZoomInTrigger render = { < ToolbarButton size = "small" /> } >
86+ < ZoomInIcon />
87+ </ ChartsToolbarZoomInTrigger >
88+ </ Tooltip >
89+ < Tooltip title = "Zoom out" >
90+ < ChartsToolbarZoomOutTrigger render = { < ToolbarButton size = "small" /> } >
91+ < ZoomOutIcon />
92+ </ ChartsToolbarZoomOutTrigger >
93+ </ Tooltip >
8794
88- < ResetZoomButton > Reset</ ResetZoomButton >
89- < VerticalDivider orientation = "vertical" />
90- < Tooltip title = "Print" >
91- < ChartsToolbarPrintExportTrigger
92- render = { < ToolbarButton render = { < IconButton /> } /> }
93- options = { { fileName : 'ChartWithCustomToolbar' } }
94- >
95- < PrintIcon />
96- </ ChartsToolbarPrintExportTrigger >
97- </ Tooltip >
98- < Tooltip title = "Export as PNG" >
99- < ChartsToolbarImageExportTrigger
100- render = { < ToolbarButton render = { < IconButton /> } /> }
101- options = { { type : 'image/png' , fileName : 'ChartWithCustomToolbar' } }
102- >
103- < PhotoIcon />
104- </ ChartsToolbarImageExportTrigger >
105- </ Tooltip >
95+ < ResetZoomButton > Reset</ ResetZoomButton >
96+ < VerticalDivider orientation = "vertical" />
97+ < Tooltip title = "Print" >
98+ < ChartsToolbarPrintExportTrigger
99+ render = { < ToolbarButton render = { < IconButton size = "small" /> } /> }
100+ options = { { fileName : 'ChartWithCustomToolbar' } }
101+ >
102+ < PrintIcon />
103+ </ ChartsToolbarPrintExportTrigger >
104+ </ Tooltip >
105+ < Tooltip title = "Export as PNG" >
106+ < ChartsToolbarImageExportTrigger
107+ render = { < ToolbarButton render = { < IconButton size = "small" /> } /> }
108+ options = { { type : 'image/png' , fileName : 'ChartWithCustomToolbar' } }
109+ >
110+ < PhotoIcon />
111+ </ ChartsToolbarImageExportTrigger >
112+ </ Tooltip >
113+ </ Toolbar >
106114 </ Stack >
107- </ Toolbar >
115+ </ Stack >
108116 ) ;
109117}
110118
0 commit comments