open-innovations / oi-lume-viz

Lume Plugin that enables charting
https://open-innovations.github.io/oi-lume-viz/
5 stars 1 forks source link

Modularise legends #20

Closed slowe closed 1 year ago

slowe commented 1 year ago

At the moment we have legends shown on some of the charts and maps. This code is duplicated so we should standardise how it is done so it can be easily included on all visualisation types that have a legend property set.

gilesdring commented 1 year ago

Consider using HTML - insert using foreignObject either at render time or with client-side js.

I will work up a small example of use of foreignObject and share here.

slowe commented 1 year ago

I've built a page to test legends for line/bar/scatter charts and SVG/zoomable/hex maps. Legend position can be either: top, top left, top right, bottom, bottom left, or bottom right. Our opinionated default value is top.