DUHdley d'Urite
DUHdley d'Urite

Reputation: 187

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".

Upvotes: 1

Views: 2826

Answers (3)

Paul McArdle
Paul McArdle

Reputation: 31

I think the option to supress the legend display is now explicitly available in version 2.0.0:

showLabelsOnHighlight: false

Upvotes: 3

cdjackson
cdjackson

Reputation: 137

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;

Upvotes: 3

Cephei
Cephei

Reputation: 116

That option doesn't exist. The project source code (on lines 289 and 290) says

// TODO(danvk): support 'onmouseover' and 'never', and remove synonyms.
legend: 'onmouseover',  // the only relevant value at the moment is 'always'.

Therefore, for now you have to create a div with visibility as "hidden".

Upvotes: 2

Related Questions