Unknown option axisLabelColor - Dygraph v2.2.1

66 views Asked by At

I have recently upgraded to Dygraph v2.2.1 from v1.1.1 and the option axisLabelColor to color the labels of the axis is not there anymore. Was it substituted by another option or this option is not available anymore?

My current solution was to change the color through the class of the elements (dygraph-axis-label-y) but I am wondering if there is a better solution.

2

There are 2 answers

0
danvk On

As of dygraphs 2.0 (2017), CSS is the preferred way to style axis labels:

.dygraph-axis-label-y {
  color: hotpink;
}

So your approach is correct. Check out the dygraphs CSS reference.

0
Rudi Bee On

Using CSS setting up a color for y-label or y2-label as described at dygraphs CSS reference works very well.

If there are multiple graphs within a html-page the label colors set through CSS are the same for all, example: .dygraph-ylabel{color:green;}

Is there a way to set the label colors for individual axes separate for each grafics instance?

my approach within javacsript:

this changes all labels, even in "g1" and "g2": document.getElementById("g0").style.color = "black";

This gives an error, it seems that dygraph-ylabel is incorrect: document.getElementById("g0").style.color.dygraph-ylabel = "green";