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

有帮助吗?

解决方案

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top