ghtmtt / DataPlotly

D3 like plots creation with plotly in QGIS
GNU General Public License v2.0
191 stars 50 forks source link

Option for Donut Pie Chart #231

Open kikislater opened 4 years ago

kikislater commented 4 years ago

Describe the solution you'd like I succeed to represent donut pie chart like in this map :

image Now I think it could be benefit to others to have such option in this plugin.

Describe alternatives you've considered Like in documentation, I just add hole=.3, in core/plot_type/pie.py

https://plotly.com/python/pie-charts/#donut-chart

But better implementation and controlling the size of the hole should be nice. So what is needed to do (please correct me if I'm wrong) ?

Additional context URL and screen above

dominijk commented 4 years ago

@kikislater Where can I find the code pie.py to edit this?

kikislater commented 4 years ago

in core/plot_type/pie.py => https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/core/plot_types/pie.py#L42-L43

ghtmtt commented 4 years ago

Thanks @kikislater for helping. @dominijk here are other instructions. Please don't hesitate to add comments if something is not clear.

You should also add an eventual checkbox to the UI (https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/ui/dataplotly_dockwidget_base.ui you can use Qt Designer to do that) and then be sure to add the widget to the correct plot type during the UI refresh (here https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/gui/plot_settings_widget.py#L539).

Finally, depending on the widget and its value, you should pass the parameter to the function https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/gui/plot_settings_widget.py#L952

dominijk commented 4 years ago

@ghtmtt and @kikislater thank you, so i'd need to install the plugin from my own build rather than just find the python file from the official plugin and edit that?

ghtmtt commented 4 years ago

@ghtmtt and @kikislater thank you, so i'd need to install the plugin from my own build rather than just find the python file from the official plugin and edit that?

yeah, that you be definitely better so that you can test locally if the changes introduced are working nice

kikislater commented 4 years ago

You should also add an eventual checkbox to the UI (here https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/gui/plot_settings_widget.py#L539) and then be sure to add the widget to the correct plot type during the UI refresh (here https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/gui/plot_settings_widget.py#L539).

Finally, depending on the widget and its value, you should pass the parameter to the function https://github.com/ghtmtt/DataPlotly/blob/master/DataPlotly/gui/plot_settings_widget.py#L539

Every modifications are in the same function ? All links are the same.

ghtmtt commented 4 years ago

Every modifications are in the same function ? All links are the same.

my fault, comment edited

kikislater commented 4 years ago

Thank you Matteo !