Skip to content

pie legends with conflicting colors #2858

Closed
@alexcjohnson

Description

@alexcjohnson

Pointed out by @nicolaskruchten

If you make several pie charts that share one or more labels but give them different colors, you get one legend entry per label, using the first color only:
https://codepen.io/alexcjohnson/pen/Zjvqee?editors=0010
screen shot 2018-07-30 at 4 09 30 pm
and clicking the legend entry for a label makes all copies - even the ones with a different color - disappear. This is confusing, but it's not 100% clear what the right fix is. The case I'm imagining is pies representing distinct data but expressed with the same labels. Like two survey questions, "How many scoops of ice cream do you want" and "How many cherries should there be on top", each with answers "0", "1", "2", "3 or more"

The two options that come to mind for how to resolve this:

  • Make one legend entry per label/color combination. This seems the most flexible, as you could for example show/hide each slice independently. But it could be confusing, especially since we don't have a way to split up the legend or to interleave subheadings, to have multiple entries with matching labels.
  • Show all of the colors next to each other in a single legend entry, kind of like we do for candlestick (though that's just 2 colors, this could be arbitrarily many). This would be more compact, could avoid the confusion ^^ (though could add more confusion if there are too many colors), and if the pies were related enough in meaning you might want to analyze them together - for example, yes/no/maybe questions, you want to hide all the maybes and just compare yes and no for all of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions