Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set default preview width to Rickshaw.Graph.RangeSlider

I am new to Rickshaw JS toolkit. In the example give at http://code.shutterstock.com/rickshaw/examples/extensions.html the preview bar(Rickshaw.Graph.RangeSlider) at the bottom of the graph used to select the time frame is by default the total time frame available.

How to customize the default preview as last one minute and minimum preview width for RangeSlider?

Thanks in Advance.

like image 501
Dileep17 Avatar asked Dec 29 '13 15:12

Dileep17


1 Answers

I know that this question is old, but in case anyone stumbles upon the same problem: DON'T fake mouse events. Looking at the slider's code, what it does when slided is to set the xMin and xMax of the graph window and update it then. We can do the same - after the initialization of the graph call:

// lower limit            
graph.window.xMin = 5;
// upper limit
graph.window.xMax = 10;
// this will also update the slider
graph.update();
like image 185
Michael Tannenbaum Avatar answered Oct 20 '22 00:10

Michael Tannenbaum