How to instance a component chart?

Hello,

I'm trying to make a component with charts, so, I can create many charts as I want just calling the component.

For the chart, I used the example in the docs. Getting started with Vue Chart component - Syncfusion
I just copy the code in a component

Then, I call the component:
...myChart...
It works, but when I call another time:
...myChart...
...myChart...
Only the sencond component is rendered.

1 Reply 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team April 5, 2021 10:48 AM UTC

Hi Emmanuel, 
 
We suspect that the reported scenario might occur due to the common id provided for both the templates. Hence we suggest you to provide separate id for each chart component to overcome the reported scenario. Based on your requirement we have also prepared a sample for your reference. Please find the sample, code snippet and screenshot below. 
 
 
Code Snippet: 
// add your additional code here 
<template> 
  <div id="app"> 
  <ejs-chart id="container"> </ejs-chart> 
  <ejs-chart id="container1"> </ejs-chart> 
  </div> 
</template> 
// add your additional code here 
 
 
Screenshot: 
 
 
If still this is not your exact requirement kindly share the runnable project with the issue faced, which will be more helpful for further analysis and provide you the solution sooner. 
 
Regards, 
Srihari M 


Marked as answer
Loader.
Up arrow icon