Hi Yauhen,
Thanks for contacting Syncfusion support. We have analyzed your query. For limiting zooming action we have written following code in preRender and zoomed event.
[JS]
function prerender(args) {
pxZoomfactor = args.model.primaryXAxis.zoomFactor;
pyZoomfactor = args.model.primaryYAxis.zoomFactor;
pxzoomposition = args.model.primaryXAxis.zoomPosition;
pyzoompostion = args.model.primaryYAxis.zoomPosition;
}
function zoomed(args) {
if (args.model.primaryXAxis.zoomFactor == pxZoomfactor && args.model.primaryXAxis.zoomPosition == pxzoomposition) {
isZoomed = true;
$("#annotation_Container_annotation_0").fadeIn(3000);
setTimeout(function () {
$("#annotation_Container_annotation_0").css("display", "none");
isZoomed = false;
;
}, 3000);
}
}
|
In “preRender” event, we have simply get the zoomposition and zoomfactor for both of the axis. In “zoomed” event, we have compared the zoomfactor and zoomposition with previous zoomfactor and zoomposition stored in the prerender event. If these are same, then zoomfactor of the chart is getting lesser than 0.001. In this case we have displayed the text “Minimum zooming value reached” inside the chart using annotation. Please find the below screenshots.
While running the sample
First time zooming the chart
Second time zooming the chart.
In the below link, we have attached the sample for your reference.
Sample link:
http://www.syncfusion.com/downloads/support/forum/123554/ze/Zooming-1270615698
Please let us know if you have any concern.
Regards,
Sanjith.