Grap selection

Hi,
Is there any way by which we can give to user in default functionality of the dashboard
, that he can select chart-type or grid etc using drag and drop or using context menu. By which the selected item gets added into the panel.?



1 Reply

SP Sowmiya Padmanaban Syncfusion Team March 4, 2020 06:31 AM UTC

Hi RakhiS,  
 
Greetings from Syncfusion support. 
 
We have checked your reported query. We suspect that your requirement is to Dynamically add Panel to the Dashboard layout. We have prepared a sample for your requirement to add a panel during button click. 
 
Refer the below code snippet. 
BtnClick() { 
    // adding panel dynamically 
    let panel: PanelModel[] = [{ 
      id: "layout_" + this.count.toString(), 
      'sizeX': 4, 'sizeY': 2, 'row': 2, 'col': 0, 
    }]; 
    this.Dashboard.addPanel(panel[0]); 
    //rendes the (CustomTemplate-chart component) temaplte in dom 
    const templateValue = this.CustomTemplate.createEmbeddedView(null); 
    // inserts the template into the view container 
    this.viewContainer.insert(templateValue); 
    // Obtaining the content element of the panel 
    let panel_Content = document.getElementById("layout_" + this.count.toString() + "_content"); 
    // appending the template to the panel content element. 
    panel_Content.appendChild(templateValue.rootNodes[0]); 
  }   
} 

Refer the sample link below. 
 
Please let us know, if you have any concerns. 
 
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon