Chart.js Polar Area Chart

A polar area chart is similar to a pie chart, but each dataset has the same angle, and the radius of the segments varies according to the provided values.

Mixed CharttypeThe property ispolarArea。

const config = {
  type: 'polarArea',
  data: data,
  options: {}
};

Next, let's create a simple polar area chart:

Example

const ctx = document.getElementById('myChart');
const data = {
  labels: [
    'Red',
    'Green',
    'Yellow',
    'Grey',
    'Blue'
  ],
  datasets: [{
    label: 'Polar Area Chart Example',
    data: [11, 16, 7, 3, 14],
    backgroundColor: [
      'rgb(255, 99, 132)',
      'rgb(75, 192, 192)',
      'rgb(255, 205, 86)',
      'rgb(201, 203, 207)',
      'rgb(54, 162, 235)'
    ]
  }]
};
const config = {
  type: 'polarArea',
  data: data,
  options: {
    responsive: true, // Set the chart to be responsive and change according to the screen window
    maintainAspectRatio: false,// Keep the chart's original aspect ratio
  }
};
const myChart = new Chart(ctx, config);

Try it Yourself »

The output of the above example is:

Other Extensions