Fork me on GitHub

Using Dygraphs to load down-sampled data while zooming - Example 3

This example adds pan interaction handling. i.e. Holding SHIFT while dragging the graph. Currently, to handle the pan interaction we have to hook in to Dygraphs internals. This example is the first time we've had to rely on non-public Dygraphs variables. This example also differs from previous in that the autoRange for y-axis has been enabled.

Files

example3.html
This page. Contains the graph container's HTML, range selector buttons, and this documentation. No javascript.
j/JGS.Demo3Page.js
This is the most relevant file. Contains all of the Dygraphs specific handling. 95% is the same as example 1 & 2.
j/JGS.GraphDataProvider.js
Responsible for getting range and detail data from the server/simulator and then aggregating,splicing, and converting it for dygraphs. This file is shared with example 1 & 2.
j/JGS.ServerDataSimulator.js
Simulates a remote time series data service. Includes simulated delays. This file is shared with example 1 & 2.