chartjs-plugin-zoom icon indicating copy to clipboard operation
chartjs-plugin-zoom copied to clipboard

Zoom speed?

Open vzelenko opened this issue 10 years ago • 20 comments

Hi, I have tried varying Zoom sensitivity value from 10 (very slow) to 0.0001 (pretty fast) but it seems that the dataset is Zoomed in 1 data point at a time.

Is there any way to control the 'step' of zoom function?

Thanks for any help.

vzelenko avatar Oct 27 '16 16:10 vzelenko

@vzelenko this is not currently possible

etimberg avatar Oct 28 '16 13:10 etimberg

Just putting out there that I would love to have this as well!

HugoPeters1024 avatar Dec 18 '18 19:12 HugoPeters1024

+1 When dealing with a huge set of datapoints, I think having to increase the 'step' of zoom will be helpful.

srv91 avatar Jan 15 '19 07:01 srv91

+1

miguel550 avatar Jan 21 '19 18:01 miguel550

+1

honcumilan avatar Jan 25 '19 12:01 honcumilan

+1

michal-podzimek avatar Jan 25 '19 17:01 michal-podzimek

+1

fbc avatar Feb 19 '19 18:02 fbc

+1

gregpaton08 avatar Feb 19 '19 20:02 gregpaton08

@benmccann I suggest to add a speed property that handles the coefficient of zoom by wheel:

zoom: {
  enabled: true,
  mode: 'xy',
  sensitivity: 3,
  speed: 10 // would be a percentage
}

I'm working on a PR.

jledentu avatar Feb 27 '19 00:02 jledentu

@jledentu - The sensitivity option is exactly what i was looking for. I have a large set of data (8,000 points) and it take ages to zoomIn.. i tried using it as you suggest above but it doesn't completely work.. Can you add a link to a working example? I tried this I also suggest adding an example to readme because there is no documentation about it..

ThinkerBell1 avatar Jun 06 '19 11:06 ThinkerBell1

@jledentu - The sensitivity option is exactly what i was looking for. I have a large set of data (8,000 points) and it take ages to zoomIn.. i tried using it as you suggest above but it doesn't completely work.. Can you add a link to a working example? I tried this I also suggest adding an example to readme because there is no documentation about it..

I have the same issue, is anyone able to make this work?

koba-1 avatar Dec 12 '19 18:12 koba-1

@jledentu - The sensitivity option is exactly what i was looking for. I have a large set of data (8,000 points) and it take ages to zoomIn.. i tried using it as you suggest above but it doesn't completely work.. Can you add a link to a working example? I tried this I also suggest adding an example to readme because there is no documentation about it..

Same issue here, any updated information about this issue?

ferreria23 avatar Mar 04 '20 13:03 ferreria23

me too

ghoulboy avatar Mar 18 '20 20:03 ghoulboy

Similar issues here. Very slow in zooming and panning. Any updates?

ShengHow95 avatar Apr 27 '20 13:04 ShengHow95

me too

camilotabaresj avatar May 05 '20 23:05 camilotabaresj

I have a same issue

danhk0612 avatar May 06 '20 08:05 danhk0612

Saying me too on a closed bug with no extra info doesn't help much. I'd recommend filing a new issue with more info:

  • What version of the plugin and chart.js?
  • Have you tried the speed and sensitivity options?
  • What axis type?
  • What is happening vs what do you expect?
  • Provide an interactive example on a site like plunker

benmccann avatar May 06 '20 12:05 benmccann

Hi, and good evening,

I have the same issue.

  • What version of the plugin and chart.js? Chartjs: 2.9.3 Zoom: 0.7.7

  • Have you tried the speed and sensitivity options? Yes, it almost doesn't help

  • What axis type? x-axis

  • What is happening vs what do you expect? The zoom on the y-axis works perfectly but the x-axis doesn't work when the mouse cursor while zooming is on the left side and when the cursor is on the right side it does the zoom but really slow. I tried the zoom by dragging the rectangle, unfortunately, I got the same result, the x-axis didn't work but the y-axis worked fine.

  • Provide an interactive example on a site like plunker https://codepen.io/yoelz55/pen/WNQLxRN

Thank you in advance for any help, Yoel

yoelz55 avatar May 19 '20 19:05 yoelz55

Hi there! I have everything the same like @yoelz55 have.

mikhailtsai avatar Jul 22 '20 12:07 mikhailtsai

My solution to this problem is to take the unminified source code and adjust the zooming step size. Because the step size is hardcoded, there is no other way to set this.

I have a standard chart with type = 'bar'. Zooming using the mouse wheel gets you in the function zoomCategoryScale();. For other types of charts you could end up using one of the other zoomXxxxScale(); functions.

The goal of that function is to determine the new min index and max index of the range for the chart. Depending on the direction of your turning the mouse wheel, the min index gets +1 or -1. These +1 and -1 are hardcoded in the plugin, but you can change them of course or use a variable so it becomes configurable using the zoomOptions.

If you change this step size to, let's say 10, the charts zooming is done by 10 ticks instead of 1 tick on the x-as at each turn of the mouse wheel. You can set it by any vale you like, of course.

kalahiri avatar Nov 20 '20 18:11 kalahiri