6

I am using jqplot chart to draw chart it works fine, To zoom chart i am using cursor and by that cursor i can zoom but i am trying to zoom that from button that is outside of chart. Since we are reset the zoomed chart from external button like this $('#reset').click(function() {plot1.resetZoom() }); so is it possible to do zoom chart from external button. Please advice...

Thanks in advance...

2 Answers2

0

Sorry this isn't a complete answer as I see no desire for me to ever want this, but you have two options as I see it:

  1. You could determine your "zoom factor" which you would apply to min(x,y), max(x,y) then replot() with the new options. The drawback to this is that you could not zoom out with a double-click. You could invoke a replot() using default zoom factor on a custom plot double-click handler.
  2. You could find out what handlers are involved in clicking and dragging on the plot and simulate that with a fixed co-ordinates -- basically the "zoom factor" again
gillyspy
  • 1,578
  • 8
  • 14
  • Do you have any example for this? Since you were wondering of a use case for this, it could be a good workaround to enable zooming on a touchscreen device, since the cursor plgin can not really be tracked on a touch device. only the click and doubleclick events work on a touch device. – gco Apr 02 '14 at 14:28
-2

Hi Swan i think you need to use this function Enable plot Zooming hope it will helpful for you. All the best

Again jqPlot is an awesome javascript graphing library, supporting loads of cool features. Except clickable bar charts. Here is a plugin which allows you to capture click events for bar charts.

$.jqplot('Graph', data, {
barClickable: {
    onClick: function(i, j, data){
alert("Clicked series: " + i + ", data point: " + j + ", data: " + data);
    }
}});
OnkarDhane
  • 1,450
  • 2
  • 14
  • 24
  • you are correct we can enable it by zoom = false but it zooms inside chart but i want to zoom it from outside button... check my question. –  Feb 23 '12 at 12:27