title: Show multiple charts at HTML page?
body: <p>I need to show multiple charts using chart.js.</p>
  
  <p>I know how many charts I need only after the user sends the data so I can't write different canvas-id at the HTML file(i don't know how many I need). </p>
  
  <p>So my question is how can I show a number of charts without know it at the beginning? (every chart is a different row at the matrix)</p>
  
  <p>my code:</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;div class="chart-container"&gt;
                &lt;div class="pie-chart-container"&gt;
                  &lt;canvas id="pie-chartcanvas-1"&gt;&lt;/canvas&gt;
              &lt;/div&gt;
           &lt;/div&gt;
  
       &lt;!-- javascript --&gt;
       &lt;script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>var piechart = $("#pie-chartcanvas-1");
       var data1 = {
       labels: itemsArr,
       datasets: [
       {
        label: "Population (millions)",
        backgroundColor:
        ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850","#3cba9f"],
        data: mat[0]
         }
         ]
         };
  
       var chart = new Chart(piechart,{
       type:"pie",
       data : data1,
       options:{
         title: {
            display: true,
            text: namesArr[0]
       }
  
     }});
  </code></pre>