dygraphs charts are a combination of DOM elements and pixels on a
<canvas>. The parts that are DOM elements can be styled
As a general rule of thumb, all the text on a chart (the legend, the axis labels, the chart labels) can be styled. The data series and gridlines are drawn on the canvas and must by styled using dygraphs options.
This chart shows the CSS classes for chart labels:
The CSS classes for the chart labels are:
- x-axis label:
- y-axis label:
- y2-axis label:
The axis labels ("2000", "4000", "6000", … for the y-axis and "1920", "1930", "1940", … for the x-axis) also get CSS classes:
The legend has the
.dygraph-legend class. When using highlightSeriesOpts, the selected
series' <span> gets a
.highlight class. This can be used to
show only a single series in the legend.
For CSS classes and annotations, see the annotations documentation.