Chartjs-Chartjs Polar Area Chart – Data labels shown don't rotate with startAngle

0👍

Update to V3, there they do turn with the chart if you adjust the startAngle

var options = {
  type: 'polarArea',
  data: {
    labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
    datasets: [{
      label: '# of Votes',
      data: [2, 9, 3, 5, 2, 3],
      borderWidth: 1
    }]
  },
  options: {
    scales: {
      r: {
        startAngle: 180,
        ticks: {
          display: false
        },
        pointLabels: {
          display: true
        }
      }
    }

  }
}

var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
    <canvas id="chartJSContainer" width="600" height="400"></canvas>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.6.0/chart.js"></script>
</body>

V3 has some breaking changes over V2, for all of them you can read the migration guide

Leave a comment