TomTichy
TomTichy

Reputation: 627

Custom plotter for only specific series

I have a graph with two series. I'd like to plot one using the default plotter and one using a custom plotter. Is that possible?

I see there is the option plotter: function(e) { } which is called for each series. However, I'd like the first series to be plotted using the default plotter. Is that possible?

Upvotes: 0

Views: 327

Answers (1)

danvk
danvk

Reputation: 16955

You can set the plotter on a per-series basis. For example, if your columns are X, Y1 and Y2:

new Dygraph(div, data, {
  series: {
    // no per-series plotter for Y1
    'Y2': {
      plotter: function(e) { ... }
    }
  }
});

The "Bar & Line Chart" on the plotters demo shows a complete example of this.

Upvotes: 1

Related Questions