We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Make Pert example editable

Hello,

I am interested in extending the functionality of the Pert chart example - https://ej2.syncfusion.com/vue/demos/#/material/diagram/pert-chart.html
Here are a couple of questions I have:

1. How would I make the nodes editable.  For example I would like to be able to click on one of the nodes and change the start date.
2. Is it possible to drag one of the nodes to a different location on the diagram?

Thanks!

5 Replies

RT Ramya Thirugnanam Syncfusion Team July 12, 2019 09:39 AM UTC

Hi Derrick,  
 
Thanks for contacting Syncfusion support. 
 
Query  
Response  
How would I make the nodes editable.  For example I would like to be able to click on one of the nodes and change the start date.  
We have enabled zoomPan in the pert chart online sample. So only you could not able to select/edit a node. We have created a sample in which we have removed zoomPan tool as shown in the below code example.  
  
Code example:  
  
    tool: DiagramTools.ZoomPan  
 
Also, you can use click event which triggers when you click on a node. In this event, you can get an node annotations value (example: startDate, endDate ). Please refer to an code example below.  
 
Code example:  
 
<ejs-diagram style='display:block' ref="diagramObj" id="diagram" :width='width' :click="click" ></ejs-diagram>  
 
     click: (args) => {  
         if(args.element) {    
           //iterate an node annotation  
          if(args.element && args.element.annotations.length > 0) {  
             for( var i = 0; i < args.element.annotations.length; i++) {  
                var annotation = args.element.annotations[i];  
                //get an annotation content  
                var content = annotation.content;  
           
         
          
      },  
 Is it possible to drag one of the nodes to a different location on the diagram?  
Yes, you can drag a node to a different location in diagram.  
 
 
Regards,  
Ramya T 



DW Derrick Whiting July 12, 2019 04:17 PM UTC

That worked!  Thank you so much for the quick reply.


SG Shyam G Syncfusion Team July 15, 2019 10:43 AM UTC

Hi Derrick, 
Thanks for your update. 
Regards, 
Shyam G 



TD Thin D July 16, 2019 04:13 PM UTC

Hello Syncfusion support,

How can we enable zoomPan and make the nodes editable with SingleSelect.

As I knew, I can use Ctrl + mousewheel for zooming, I want to apply the panning feature in the diagram e.g Shift + mousemove

Thanks,




RT Ramya Thirugnanam Syncfusion Team July 17, 2019 06:04 AM UTC

Hi Thin,  
  
Please set diagram tool property as  ZoomPan and SingleSelect to achieve your requirement. Please refer to the code example and help documentation below.  
  
Code example 
<ejs-diagram style='display:block' ref="diagramObj" id="diagram"   :tool='tool'></ejs-diagram>  
  
export default {  
    name: 'app'  
        data () {  
            return {  
                width: "100%",  
                height: "350px",  
                tool: DiagramTools.ZoomPan | DiagramTools.SingleSelect,             
            
         
     
 
 
Regards,  
Ramya T 


Loader.
Live Chat Icon For mobile
Up arrow icon