New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pan Zoom #2
Pan Zoom #2
Conversation
Thank you for your PR! I'm glad you like this plugin and find it useful. I would prefer refactoring the panZoomLeft() and panZoomRight() functions to panZoom(-offset) and panZoom(+offset), and to remove the pan.incrementer option altogether. This will allow for example for a set of buttons below the chart with different pan increments/decrements (-1M, -1H, -1D, +1D, +1H, +1M) In addition, we need to add support for adding moment.js durations as well to support charts with a time axis. Agreed? |
@AbelHeinsbroek thanks for the quick response! Agreed on refactoring the panzoom api--just pushed up those changes. I also noticed that if you don't add data to a chart js instance immediately, As for the moment duration changes, I'm having a bit of trouble getting zoom functionality working. I pushed up an example in
In this example, |
That's because you enter strings as input in your example: function newDateString(days) {
return moment()
.add(days, "d")
.format();
} If you pass in the moment object directly it works fine: function newDateString(days) {
return moment()
.add(days, "d")
} |
Hm ok--it looks like Can you confirm when you get a chance? |
@AbelHeinsbroek Any chance you've had a moment to look at this? |
Looks good to me! |
Awesome! thanks again :) |
@AbelHeinsbroek fyi I'm not seeing the package updated with the latest change--any chance you could republish? |
Thanks, forgot to run gulp before publishing. |
Found your plugin super useful! I needed the ability to pan a zoomed portion of the branch, so I essentially reused your
doZoom
method and exposed thepanZoom
functionality on the chart instance. There should be no change to the existingdoZoom
method other than adding those properties to thecrosshair
object.I bumped the minor version manually--I don't know your deployment scheme, so I can take this commit out if needed.
(Side note: sorry for the whitespace changes in
/samples/index.html
, my linter had its way with that file. Figured I'd leave it given it was taking queues from your eslintrc).