Chartjs-Use chart.js create two pie-charts only can display

0👍

The issue is how you are configuring the first chart.

When you are setting "data" config, you are setting using the name of the variable which is "data1" and not "data" as CHART.js requires.

  // config 
  const config1 = {
    type: 'pie',
    data1,  // <-- WRONG!!!
    options: {

Use the following:

  // config 
  const config1 = {
    type: 'pie',
    data: data1,  // <-- CORRECT!!!
    options: {

Leave a comment