Search code examples
dygraphs

How to suppress legend display in Dygraphs


Is there a parameter for the Dygraphs legend option (e.g., 'never') that will hide the legend entirely? I'm looking for the opposite of "always", and hoping there is a cleaner way to suppress the legend than associating it with its own labelsDiv, creating that div, and styling that div's visibility as "hidden".


Solution

  • As already stated, there doesn't seem to be an explicit option right now, but you can easily set the labelsDivWidth option to 0 to hide it.

    options.labelsDivWidth = 0;