Hi Jim
We suggest you to use zoom “focusPoint” property in order to achieve your requirement. Please refer the code snippet and sample below.
Code snippet:
function zoomin() {
var diagram = $("#Diagram1").ejDiagram("instance");
var node = diagram.selectionList[0];
var zoom1 = ej.datavisualization.Diagram.Zoom();
if(node)
zoom1.focusPoint = { x: node.offsetX, y: node.offsetY };
diagram.zoomTo(zoom1);
}
Sample:http://www.syncfusion.com/downloads/support/directtrac/118398/zoomfocuspoint2099359955.zip
Please let me know if any concerns.
Regards,
Shyam G
As you can see from the video, this is not happening.
Any suggestions?
Thanks
Jim
Hi Jim,
Thanks for your update.
We suggest you to move the selected Node to the centre of the diagram while zooming to achieve your requirement. Please refer the below code snippet and sample for your reference.
Here is the code snippet:
[JS]
var diagram = $("#Diagram1").ejDiagram("instance");
var node = diagram.selectionList[0];
var zoom1 = ej.datavisualization.Diagram.Zoom();
if (node) {
diagram.updateNode(node.name, { offsetX: $(diagram.element).width() / 2, offsetY: $(diagram.element).height() / 2 });
zoom1.focusPoint = { x: node.offsetX, y: node.offsetY };
}
diagram.zoomTo(zoom1);
Here is the Sample:
Sample
Please try the above and let us know if any concern.
Regards,
Ashok Kumar.
Hi Jim,
Please ignore the previous update and sorry for the inconvenience caused.
We are glad to inform you that we have created a simple sample to achieve your requirement. We suggest you to use diagram’s “bringToCenter” to achieve your requirement, also we have fixed the bugs in the diagram’s “bringToCenter” and the modified “ej.web.all.min”. Please try the below sample and code and let us know if it complies with your requirement, if not please get back to us.
Here is the code snippet:
[JS]
var diagram = $("#Diagram1").ejDiagram("instance");
var node = diagram.selectionList[0];
var zoom1 = ej.datavisualization.Diagram.Zoom();
if (node) {
var bounds = ej.datavisualization.Diagram.Util.bounds(node);
diagram.bringToCenter(bounds);
}
diagram.zoomTo(zoom1);
Here is the Sample:
Here is the File:
Please let us know if any concern.
Regards,
Ashok Kumar.