ocadotechnology/hexagonjs

Plot does not necessarily grow tall enough to include its own legend

Opened this issue · 1 comments

pmpfr commented

Context

We had a bar graph with min-height: 100px; (in css) which displayed fine. We then added a legend

   legendEnabled: true,
   legendLocation: LegendLocation.TopRight,

and had to increase min-height by hand to be big enough to include the legend.

Expected Behavior

When a graph has a legend, it should always size itself large enough to display it.

Actual Behavior

The lengend was truncated.

Possible Fix

Calculate the height required for the legend as well as the height required to display the main graph and take the maximum to be the overall min height. Potentially the same issue exists for width.

Steps to Reproduce

Your Environment

  • Hexagon Version:
    1.17.1
  • Browser Name and version:
    Safari
  • Operating System and version (desktop or mobile):
    Mojave 10.14.3
pmpfr commented

graph with truncated legend

(The bar labels have been manually redacted by me in the image. The legend is as shown in the browser.)