DataPlotly icon indicating copy to clipboard operation
DataPlotly copied to clipboard

Option for Donut Pie Chart

Open kikislater opened this issue 5 years ago • 8 comments

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) ?

  • declare option in core/plot_settings.py
  • declare option in gui/plot_settings_widget.py
  • Add option to .ui

Additional context URL and screen above

kikislater avatar May 21 '20 10:05 kikislater

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

dominijk avatar Jun 28 '20 13:06 dominijk

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

kikislater avatar Jun 28 '20 15:06 kikislater

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

ghtmtt avatar Jun 30 '20 13:06 ghtmtt

@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?

dominijk avatar Jun 30 '20 13:06 dominijk

@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

ghtmtt avatar Jun 30 '20 13:06 ghtmtt

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.

kikislater avatar Jun 30 '20 14:06 kikislater

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

my fault, comment edited

ghtmtt avatar Jun 30 '20 14:06 ghtmtt

Thank you Matteo !

kikislater avatar Jun 30 '20 14:06 kikislater