How to combine simple d3.js chart (for example http://bl.ocks.org/2579599) with jQuery.ui range slider?
With this slider I’d to control x-axis scale (begging and end of data series). I expect that my chart will contain large data set and ideally it should be done without redrawing the whole chart.
How to combine simple d3.js chart (for example http://bl.ocks.org/2579599 ) with jQuery.ui range slider?
Share
If you do not mind redrawing the points, then controlling the beginning and end of the x-axis with a scale can be achieved by changing the domain of x in the callback methods of the jQuery range slider.
To make this pretty you can do this using a transition and by adding a clipping rectangle.
The range slider callbacks would look something like this:
I added this together with the clipping to get bl.ocks.org/3878029. Is this the kind of scaling of the x-axis that you imagined? It does redraw the path and the x-axis but I am not sure how you can avoid redrawing that seeing how you want it to change.