semiotic icon indicating copy to clipboard operation
semiotic copied to clipboard

More position options for the legend

Open dgwyer opened this issue 3 years ago • 2 comments

At the moment we have two options to position the legend to the left or right of the chart area. There are plenty of times that I need the legend to be displayed (centered) above or below the chart too, such as when one of the data series labels is too long.

image 8

It would be nice to be able to do something like this (mockup):

Frame 1

While I think of it, adding the legend inside the chart area looks good too (obviously this depends on the number of series and the specific data):

image 14

Also, it would be very useful to have other settings to:

  • Control the gap between legend items. This should be applied vertically for the default legend, and horizontally when the legend orientation is set to horizontal.
  • Disable the legend title and the line drawn underneath (don't need it when displaying the legend above or below the chart).
  • Add a margin around the legend.
  • Wrap legend series nicely when displaying horizontally. If you have more than, say, 3 or 4 series then this may be needed.

dgwyer avatar Jan 26 '22 14:01 dgwyer

This definitely needs to happen. I think we can offer the interior options as well, though I doubt we can do anything smart (like avoiding regions with datapoints) for a while, despite the fact that we have the capability to do it.

emeeks avatar Feb 05 '22 02:02 emeeks

Manual placement of the legend inside the chart would be fine for now I think. And dynamic positioning could be looked into in the future perhaps?

dgwyer avatar Feb 05 '22 12:02 dgwyer

I've evolved my thinking on legends. I think any kind of more exhaustive legend should be built 3rd party rather than built into Semiotic because of the different kinds of legends and the functionality they include (interactivity for instance).

emeeks avatar Jan 29 '23 03:01 emeeks