Search code examples
dygraphs

Limiting the range of y-axis


I have values on my y-axis from 0.0 to 1.0, but I'm only interested in 0.0 - 0.4. Is there a way I could only show points in range 0.0-0.4? I know dygraphs has also horizontal zoom. It would be great to have this when I load the graph.

Thanks


Solution

  • You want the valueRange option. If you specify it in the constructor, it will restrict the range of your y-axis on the initial draw:

    new Dygraph(div, data, { valueRange: [0, 0.4] });