Let the first sector of a pie chart unfold counterclockwise
See original GitHub issueWhen I create a pie chart, and I set attribute direction = "counterclockwise"
, I would like that the first sector can be configured to unfold counterclockwise as well.
Although I could “manually” compute the angular width of the sector and subtract it from the desired value in the rotation
argument, that would still fix the first edge (in clockwise order) when I turn on/off categories in the legend, and thus the last edge would not be aligned with the desired rotation. The desired behavior would be that the last edge is fixed so that the rotation
argument fixes the rotation of the first sector shown, no matter which one it is.
In this example, the first sector “a” unfolds clockwise, while the categories are plot counterclockwise from the reference direction (12 o’clock):
As a workaround, I can subtract the width of first category from the desired value for
rotation
; this is ok as long as all traces are active, but not when they are clicked on/off on legend:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
This makes sense and we’d certainly accept a pull request that added a new attribute to
pie
traces to control the placement of the first slice to make it work more similarly to something like Excel 😃This attribute could be called e.g.
firstslicedirection
with accepted valuesforward
andreverse
(defaulting toreverse
to preserve the current behaviour for existing users).I think that it’s more flexible/orthogonal to support forward/reverse with respect to the existing
direction
attribute, so ifdirection
isclockwise
then thereverse
firstslicedirection
means “counterclockwise” and vice-versa.