Articles in this section

How to Render an Angular Chart Inside a Dialog Component?

This article demonstrates how to embed a Angular Chart inside a Dialog component. This approach is useful when you want to present data visualizations in a modal popup, allowing users to view charts without navigating away from the current page.

Prerequisites

Before implementing this, ensure the following packages are installed:

npm install @syncfusion/ej2-angular-charts @syncfusion/ej2-angular-popups 

Implementation

To render a chart inside a dialog, use the component along with an ng-template for the chart content. Below is a sample implementation:

<ejs-dialog
   #Dialog
   [target]="target"
   (open)="dialogOpen()"
   (close)="dialogClose()"
 >
   <ng-template #content>
     <ejs-chart
       style="display:block;">
       <e-series-collection>
         <e-series
           [dataSource]="columnData"
           type="Column"
           xName="country"
           yName="walnuts"
           name="Walnuts"
           [cornerRadius]="cornerRadius"
           legendShape="Rectangle"
           columnSpacing="0.4"
         >
         </e-series>
       </e-series-collection>
     </ejs-chart>
   </ng-template>
 </ejs-dialog> 

Output

image.png

Live Sample

StackBlitz Sample

See Also

Chart - Getting Started Documentation
Dialog - Getting Started Documentation

Conclusion

I hope you enjoyed learning about how to render an Angular Chart inside a Dialog component.

You can refer to our Angular Chart’s feature tour page to learn about its other groundbreaking feature representations. You can also explore our Angular Chart Documentation to understand how to present and manipulate data.

For current customers, you can check out our Angular components on the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to explore our Angular Chart and other Angular components.

If you have any queries or require clarifications, please let us know in the comments below. You can also contact us through our support forums, Direct-Trac or feedback portal, or the feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied