You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data/charts/tooltip/tooltip.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ import { chartsTooltipClasses } from '@mui/x-charts';
118
118
/>;
119
119
```
120
120
121
-
To apply the same style as above, use the `sx` prop of the tooltip itself, thanks to`slotProps.tooltip`.
121
+
To apply the same style as above, use the `sx` prop of the tooltip itself, which should be set in`slotProps.tooltip`.
122
122
123
123
{{"demo": "TooltipStyle.js"}}
124
124
@@ -144,10 +144,10 @@ With compositon, you can use your component inside the container.
144
144
```
145
145
146
146
:::warning
147
-
If your custom tooltip does not use portal, it can not render inside the ChartContainer.
148
-
Overwise it would render an HTML element inside a SVG.
147
+
If your custom tooltip is an HTML element and does not use portal, it cannot render inside the ChartContainer.
148
+
Otherwise it would render an HTML element inside an SVG.
149
149
150
-
The solution is to put your tooltip inside the ChartDataProvider to get data, but outside ChartSurface to avoid being inside the SVG.
150
+
The solution is to render your tooltip as a descendant the ChartDataProvider so it can access the chart data, but outside ChartSurface so it isn't rendered inside an SVG element.
151
151
152
152
```jsx
153
153
<ChartDataProvider>
@@ -162,9 +162,9 @@ The solution is to put your tooltip inside the ChartDataProvider to get data, bu
162
162
163
163
To create your custom tooltip, the library exports some helpers which are explained in the following sections:
164
164
165
-
-`<ChartsTooltipContainer />`A wrapper providing the open/close state and the position of the tooltip.
166
-
-`<ChartsItemTooltipContent />`render the content of the default item tooltip.
167
-
-`<ChartsAxisTooltipContent />`render the content of the default axis tooltip.
165
+
-`<ChartsTooltipContainer />`a wrapper providing the open/close state and the position of the tooltip.
166
+
-`<ChartsItemTooltipContent />`renders the content of the default item tooltip.
167
+
-`<ChartsAxisTooltipContent />`renders the content of the default axis tooltip.
168
168
-`useItemTooltip()` provides all basic information associated to the current item tooltip.
169
169
-`useAxesTooltip()` provides all basic information associated to the current axes tooltip.
170
170
@@ -192,14 +192,14 @@ Then you can either render built-in content (with `<ChartsItemTooltipContent />`
192
192
</CustomTooltipPopper>
193
193
```
194
194
195
-
The following demo shows example about how to use additional hooks such as `useXAxis()`or`useDrawingArea()` to customize the tooltip position.
195
+
The following demo shows how to use additional hooks such as `useXAxis()`and`useDrawingArea()` to customize the tooltip position.
196
196
197
197
{{"demo": "CustomTooltipPosition.js"}}
198
198
199
199
#### Modifying the content
200
200
201
201
To keep the default placement, use the `<ChartsTooltipContainer />` wrapper.
202
-
It accept a prop `trigger = 'item' | 'axis'`to know when the Popper should be open.
202
+
It accepts a prop `trigger = 'item' | 'axis'`that defines when the Popper should open.
0 commit comments