1

I am using dygraphs for charting temperature and humidity values of thermal chambers taken at one minute intervals. I allow the user to programmatically specify the Y-axis extremes if desired.

If the temperature range is -40 to +100 degrees, the user can select a range of -50 to -30 degrees to highlight this area. If the user attempts to interactively zoom in further, the y-axis jumps to something like the -400 degree range.

I suspect the math being performed is not using the displayed y-axis extremes. The same is also true for looking at points in the extreme positive range also.

1 Answers1

1

I was using an input box of type number for the min and max data for the axis. Using the values as shown below:

g.updateOptions({ isZoomedIgnoreProgrammaticZoom: true, valueRange: [ymin.value, ymax.value] });

caused the problem. The zoom function appeared to work properly but trying to perform an interactive zoom on the already zoomed graph caused the values for the new zoom to be completely out of scale.

I added parseFloat() as shown below:

g.updateOptions({ isZoomedIgnoreProgrammaticZoom: true, valueRange: [parseFloat(ymin.value), parseFloat(ymax.value)] });

and everything works.

I hope this helps someone.