0

I am new to chart.js. i need help in adding a numeric value to radar chart point labels with different color. eg radar label with styling

  1. labels color should be in black.
  2. numeric value should be in a different predefined color(eg blue).

new Chart('radar-chart', {
  type: 'radar',
  data: {
    labels: ['mon 30', 'tue 40', 'thurs 25', 'fri 45', 'sat 67', 'sun 50'],
    datasets: [{
      label: 'My First Dataset',
      data: [65, 59, 90, 81, 56, 55],
      fill: true,
      backgroundColor: 'rgba(255, 99, 132, 0.2)',
      borderColor: 'rgb(255, 99, 132)',
      pointBackgroundColor: 'rgb(255, 99, 132)',
      pointBorderColor: '#fff',
      pointHoverBackgroundColor: '#fff',
      pointHoverBorderColor: 'rgb(255, 99, 132)'
    }],
  },
  options: {
    plugins: {
      legend: {
        display: false
      }
    },
    scales: {
      r: {
        pointLabels: {
          color: 'black',
          font: {
            size: 20,
            style: 'italic'
          }
        }
      }
    }
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.2.0/chart.min.js"></script>
<canvas id="radar-chart"></canvas>

the values near the labels in vertex should be in a predefined color(eg blue) -like the one attached in image.

please feel free to give a different approach to achieve this requirement. Thanks in advance for the help.

0 Answers0