I’m creating a canvas via javascript on a webproject.
The canvas has graphical representations on the x-y plane.
I am trying to add the horizontal-scrolling feature to the canvas.
I have investigated a few methodologies:-
1) draw 12 months worth of data on the canvas, when the mouse scrolls forward, 1st month’s data disappears, and at the end a new months data is added, new canvas is drawn.
Con:- Everytime the mouse scrolls to pan thru the timeline – a new SQL query has to be made, making my web application very slow.
2) maybe I can draw say 10 years worth of data on the canvas via 1 SQL query, but only show 12 months worth of the data. masking the rest of the 9 years. Now when the client scrolls, I capture the scroll event and move to the appropriate part of the canvas. Is this possible? If so then how?
Can anyone advise?

My current representation of the canvas = with only 12 months worth of data
To be more specific on the scrolling, I would like to have a feeling such as the following widget for my client-side scrolling action:-
Here’s a pretty basic implementation: http://jsfiddle.net/CQPeU/
To create a grid, you could do something like this:
Which would be used like this:
Updated demo: http://jsfiddle.net/CQPeU/2/