Skip to content

Commit 43386ba

Browse files
Apply suggestions from code review
Co-authored-by: Bernardo Belchior <Bernardo.belchior1@gmail.com> Signed-off-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
1 parent 4dc5ff1 commit 43386ba

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

docs/data/charts/tooltip/tooltip.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ import { chartsTooltipClasses } from '@mui/x-charts';
118118
/>;
119119
```
120120

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`.
122122

123123
{{"demo": "TooltipStyle.js"}}
124124

@@ -144,10 +144,10 @@ With compositon, you can use your component inside the container.
144144
```
145145

146146
:::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.
149149

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.
151151

152152
```jsx
153153
<ChartDataProvider>
@@ -162,9 +162,9 @@ The solution is to put your tooltip inside the ChartDataProvider to get data, bu
162162

163163
To create your custom tooltip, the library exports some helpers which are explained in the following sections:
164164

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.
168168
- `useItemTooltip()` provides all basic information associated to the current item tooltip.
169169
- `useAxesTooltip()` provides all basic information associated to the current axes tooltip.
170170

@@ -192,14 +192,14 @@ Then you can either render built-in content (with `<ChartsItemTooltipContent />`
192192
</CustomTooltipPopper>
193193
```
194194

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.
196196

197197
{{"demo": "CustomTooltipPosition.js"}}
198198

199199
#### Modifying the content
200200

201201
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.
203203

204204
:::warning
205205
Do not skip rendering the ChartsTooltipContainer.

0 commit comments

Comments
 (0)