Sajith
Sajith

Reputation: 2852

How to set custom fill color in dygraph

By setting the property fillGraph: true , we can fill the dygraph with its default color. But how to fill it with a custom color?

Upvotes: 2

Views: 2894

Answers (1)

danvk
danvk

Reputation: 16955

The fill color is always the same as the series color (which you can control via the colors option) but with a lower opacity, controllable by the fillAlpha option.

If you need more flexibility than this, you have two options:

  1. Create two series, one with fill and one without. You can use CSS to hide one from the legend. Demo here.
  2. Create a custom plotter that uses the colors you want. Read more about how to do that here.

Upvotes: 1

Related Questions