shpi / pi3d_ui_application

3 stars 6 forks source link

Feature request: Donut chart #3

Closed shpi closed 4 years ago

shpi commented 4 years ago
paddywwoof commented 4 years ago

I can have a go at making one of these as it could be useful in pi3d. Do you have any links to images on line with the ideal structure?

shpi commented 4 years ago

Example image of 360° version via mail. I think we can reuse part of dial class.

paddywwoof commented 4 years ago

Added pi3d end of the system https://github.com/tipam/pi3d/blob/develop/pi3d/shape/Slice.py I will make a shpi class to display values using this. Normally these are used like pie charts - stacked to fill 360 degrees. Which variables do you think should be displayed this way?

shpi commented 4 years ago

for example: disk usage cpu usage (load) ram usage

but also cpu temperature could be possible (reference to max 85°)

paddywwoof commented 4 years ago

Rudimentary system. https://github.com/shpi/zero_main_application/commit/1856f85212ced2edd4714766724a71bfaaeba999 The options in arguments should be self explanatory but here is a pic of concentric=False, full_range=False donut1 and concentric=True, full_range=400 donut2 I will add the numbers at the centre points of each slice (midway between inner and outer).

One thing that might be worth considering is switching to a Shape parent and child system for slides. That would allow graphics.slider_change() to move everything at once. I will set Donut up that way to see how well it works.

paddywwoof commented 4 years ago

Added numbers on each slice. Also I've used a system of an 'empty' object (triangle with z=-1.0) with children. Adding PointText as a child is a bit messy (as PointText is a wrapper for other things and draw() does a re_init as well as text.draw()) so I've left that out. PS I think I will make Shape.set_material() accept either a three tuple or four tuple (as works with TextBlock) so that the donut can be partially transparent.