react-nodegui icon indicating copy to clipboard operation
react-nodegui copied to clipboard

Pie Chart

Open Sydney-o9 opened this issue 4 years ago • 1 comments

Hi there,

Outstanding work - easy to set up and get started.

Would you be able to provide a bit of guidance as to how to create a Pie Chart?

image

I'd know how to do it in the browser, but how does it work in this scenario?

Thank you!

Sydney-o9 avatar Feb 13 '21 06:02 Sydney-o9

Hi - under the hood the project uses Qt widgets instead of HTML.

A quick search on the Qt Docs yields the following Qt display classes: https://doc.qt.io/qt-5/qml-qtcharts-pieseries.html https://doc.qt.io/qt-5/qpieseries.html https://doc.qt.io/qt-5/qpieslice.html

And a tutorial: https://doc.qt.io/archives/qt-5.11/qtcharts-piechart-example.html

These will need to be added into the core NodeGui before React components can be built on top of them. This is a lot of work!

But remembering that all React-Nodegui projects are still valid Node projects, it might be worth looking into D3 Charts (or another charting library). There's a nice example there about using node-canvas to generate a png, which you can then just insert as a normal image. Should be good as a workaround.

MistahMojo avatar Mar 06 '21 07:03 MistahMojo