You might be better off using a custom slider solution for this, as calling control.draw interrupts the mouse events that are allowing the user to drag the slider. There are many libraries out there that have sliders you can use.
I made a feature request to add support for an option that would allow you to get your fixed range: http://code.google.com/p/google-visualization-api-issues/issues/detail?id=1359. You can "star" the issue to get updates and let the dev team know there is interest in the feature. On Wednesday, November 13, 2013 8:46:02 AM UTC-5, Damien Lécole wrote: > > Hi, > I am new to the Google Visualization API. > I would like to get a chart looking like the one in the following website > : http://letour.yorkshire.com/stage-1 . I have thought of using the > ChartRangeFilter ControlWrapper. I try handling the statechange events to > get an invariable interval but I haven't succeed. > Here is my code : > function stateChangeHandler(a){ > if (a.startChanged == true && a.endChanged == true){ > var chart = document.getElementById("chart"); > var pos = (control.getState().range.end + > control.getState().range.start)/2; > chart.style.left = pos*4; > } > if (a.startChanged == false && a.endChanged == true ){ > > control.setState({'range': {'start': control.getState().range.end-10, > 'end': control.getState().range.end}}); > control.draw(); > var chart = document.getElementById("chart"); > var pos = (control.getState().range.end + > control.getState().range.start)/2; > chart.style.left = pos*4; > } > if (a.startChanged == true && a.endChanged == false){ > control.setState({'range': {'start': control.getState().range.start, > 'end': control.getState().range.start+10}}); > var chart = document.getElementById("chart"); > var pos = (control.getState().range.end + > control.getState().range.start)/2; > chart.style.left = pos*4; > } > } > Here is the link so you can see the my problems : > http://wgs3.s3.amazonaws.com/perso/dlecole/ASO/chartrangefilter.html > > Do you have any idea how to do or if there is a more adapted solution > without using ChartRangeFilter? > > Regards, > Damien Lécole > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
