Chad Johnson
Chad Johnson

Reputation: 21905

Possible to hide series but show value in legend for dygraphs?

I'd like to hide a series from a dygraphs chart but show the value in the legend. Is this possible?

Upvotes: 2

Views: 1266

Answers (2)

Aviad
Aviad

Reputation: 11

Try this

series: {
        'S1' : {
            axis: 'y1'
             },

    'S2': {
                 axis: 'y2'
         },
        },                                                                    
visibility: [ true, false],                                    

Upvotes: 1

Chad Johnson
Chad Johnson

Reputation: 21905

Looks like I can do this as a workaround:

series: {
  'legendOnly1': {
    strokeWidth: 0
  },
  'legendOnly2': {
    strokeWidth: 0
  }
}

If there is a better or more official way of accomplishing this, that would be cool.

Upvotes: 2

Related Questions