How to increase jqplot from an external button?

I use the jqplot chart to draw a graph, it works great. To scale the chart, I use the cursor, and with this cursor I can scale, but I'm trying to zoom in from a button that is outside the chart. Because we reset the enlarged diagram from an external button like this $('#reset').click(function() {plot1.resetZoom() }); , so you can make an enlargement diagram from an external button. Please advice ...

Thanks in advance...

+6
source share
2 answers

Sorry, this is not a complete answer, because I do not see the desire that I ever wanted it, but you have two options, as I see it:

  • You can define your โ€œscaling factor,โ€ which you would apply to min (x, y), max (x, y), then replot() with the new parameters. The disadvantage of this is that you cannot zoom out with a double click. You can call replot() using the default zoom factor for the custom double-click handler.
  • You can find out which handlers are involved when clicking and dragging a chart and simulate this with fixed coordinates - basically a โ€œzoom factorโ€ again
0
source

Hi Swan, I think you need to use this function. Enable scaling of the graph. I hope it will be useful for you. All the best

Again, jqPlot is a terrific javascript image library that supports many useful features. In addition to interactive histograms. Here is a plugin that allows you to capture click events for histograms.

 $.jqplot('Graph', data, { barClickable: { onClick: function(i, j, data){ alert("Clicked series: " + i + ", data point: " + j + ", data: " + data); } }}); 
-2
source

Source: https://habr.com/ru/post/909176/


All Articles