Export a nivo chart/diagramm as image in React

Viewed 700

I am using a nivo library for charts. I want to export as a PNG/JPEG image some react component that are using a ResponsiveBar internally. The problem is this functionality is not built-in in the library. I have components structure like this:

<MyComponent>
  <ResponsiveBar />
</MyComponent>

I need a function that takes as param this kind of React component and returns an image. Something like this:

exortChartToPng(chartComponent);
0 Answers
Related