0

I know how to change the color of a Dygraph Series using the Dygraph options:

Example:

new Dygraph(el, data, {
color: 'blue'
});

But I don't know how (or if it's possible) to define the color of a series via CSS:

Psuedo Example:

#dygraph-series-1 {
color: blue;
}
Jed
  • 10,649
  • 19
  • 81
  • 125

1 Answers1

0

You can read the css rules via javascript like so: How do you read CSS rule values with JavaScript?

then you can initialize the graph with these rules:

var myColor = readCssRule('myColor');

new Dygraph(el, data, {
color: myColor
});
Community
  • 1
  • 1
Gordon Mohrin
  • 645
  • 1
  • 6
  • 17