All examples By author By category About

ijlyttle

Vega Radial-Tree-Layout with Legend

This is a variation of the Vega Radial-Tree-Layout Example, where I have introduced a "legends" element to the spec.

"legends": [
  {"fill": "color", "type": "symbol", "title": "depth", "orient": "top-right"}
]

In a previous version of this chart, the legend would not appear; it did not have an orient element.

As it turns out, it seems necessary to supply a value for orient for this graph, but not for the tree-layout. Further, it a value of "right" did not work - it needed "top-right", which would present a problem if there is more than one legend that you wanted to appear together.