chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.51k stars 11.9k forks source link

Slider to change chart viewing range #830

Closed turbobuilt closed 8 years ago

turbobuilt commented 9 years ago

Great charts!

Will there be a viewing range slider any time soon? Slide the left and right to change the breadth of data shown?

jakesylvestre commented 9 years ago

Honestly this doesn't sound like a bad idea, probably wouldn't be in core though.

schme16 commented 9 years ago

@dtruel: I've just recently added a rage slider to my chart on a stats page I was building. I cobbled it together with noUiSlider + wNumb

It didn't take very long to do, but if you'd like I can put together a Gist that shows what I did

@jakesyl I agree it doesn't need to be in the core, there are hooks for all the events you'd need, already exposed, but creating it as a plugin would be pretty great (I might take a bash at it sometime this evening)

etimberg commented 9 years ago

@schme16 creating a plugin would be a good idea.

schme16 commented 9 years ago

I had a quick go in my spare time at work today; it's rough at the moment, but I'll be cleaning it up over the next few days! Patches welcome, of course, as is any advice about the way I'm creating the plugin!

Repo: https://github.com/schme16/Chart.js-RangeSlider JSFiddle: http://jsfiddle.net/schme16/xfyvvup8/

etimberg commented 8 years ago

Closing since this won't be in the core and @schme16 made an awesome plugin to add this functionality.