Ad

How To Add Text To Center The Pie Chart With Nivo Rocks For Reactjs?

- 1 answer

I'm having trouble adding text to center the pie chart, I'm using novio.rocks for my react project. Thanks Demo https://nivo.rocks/pie

Ad

Answer

You can add an extra div on top of the chart, centering its content using flexbox, I've created an example of this approach on codesandbox =>https://codesandbox.io/s/w27xwy0xlk Don't forget to add pointer-events: none to preserve the chart's interactivity.

Ad
source: stackoverflow.com
Ad