I have a bar graph in my web app (drawn using javascript). It can be wider than the screen, so there are arrows that move the graph along the x-axis on a click (again made using javascript).
I would like to redraw the graph when the user clicks an arrow. The data manipulation performed to generate the graph is too complex to do on the client side, and I don't want to send it all at once, as that would be a waste if the user never decides to scroll.
Instead, on a click I would like to send a request to the server for the new data needed to draw the next portion of the graph. How can this be done?
Note: I only want to request the data, not a new page. The server side is Ruby on Rails v. 3.0.4.