PureChart / purechart

Fully customizable HTML/CSS charts for Ruby on Rails 📊
https://docs.purechart.org
MIT License
75 stars 11 forks source link

Add Pie Chart Key #42

Closed yooian closed 5 months ago

yooian commented 5 months ago

Description

Added interactive key beside pie chart. Cross-over exists so hovering over an element highlights the name and corresponding slice on pie chart. Hovering over a slice highlights the corresponding name on the key.

The key can fit up to 16 elements per column and an indefinite number of rows (it overflows if there's too many though - may need new issue to deal with extremely large numbers of elements).

Added rudimentary scaling with website resizing but this will definitely need to be tweaked and updated, especially if the key will dynamically resize.

image

Changes include:

Issues Still Present:

Notes:

yooian commented 5 months ago

Idk how good the highlighting feels so let me know. It might be too tacky with the color change. Could reduce it to a simple text shift and go more minimalistic

Also, I didn't include percentages by the name because I thought having it popup on click would look better. Lmk if you have other ideas

GeorgeBerdovskiy commented 5 months ago

Personally, I love the highlighting! And I agree with you on the percentages. It seems like there may be some brower specific CSS issues because I get some interesting results when I test on my machine (which are easily fixed with some small tweaks), but otherwise it looks fantastic. Thank you for putting in the work on this 🙏

image

This is how it looks by default - not sure if the key is supposed to be fully horizontal like this.

image
yooian commented 5 months ago

Oh yeah that's weird the key should be vertical and expand horizontally