-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[charts][docs] Improve Charts export docs #17538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -63,6 +63,6 @@ As detailed in the [Composition](/x/react-charts/composition/) section, charts c | |||
When exporting a chart, the `ChartsWrapper` element is considered the root element of the chart, and every descendant is included in the export. | |||
As such, you need to ensure that the `ChartsWrapper` element is the root element of the chart you want to export. | |||
|
|||
If you want to use a custom wrapper element, you need to use the `useChartRootRef` hook to set the reference to the chart's root element so that exporting works properly, as exemplified below. | |||
If you want to use a custom wrapper element, you need to use the `useChartRootRef()` hook to set the reference to the chart's root element so that exporting works properly, as exemplified below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function should be ()
, see style guide.
|
||
## Export as image | ||
|
||
The `apiRef` prop also exposes a `exportAsImage()` method to export the chart as an image. | ||
|
||
### Dependency | ||
|
||
For `exportAsImage()` to work, you need to add `rasterizehtml` as a dependency in your project. | ||
For `exportAsImage()` to work, you need to add the`rasterizehtml` npm dependency in your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit clearer for people that wonder what a dependency is.
Deploy preview: https://deploy-preview-17538--material-ui-x.netlify.app/ Updated pages: |
CodSpeed Performance ReportMerging #17538 will not alter performanceComparing Summary
|
b8bad3f
to
0a6722a
Compare
0a6722a
to
bd27654
Compare
I noticed this from #17353 - https://deploy-preview-17353--material-ui-x.netlify.app/x/react-charts/export/.
I almost didn't see that the demos on the page were interactive (I couldn't see the call to action buttons).
Preview: https://deploy-preview-17538--material-ui-x.netlify.app/x/react-charts/export/