[Chartjs]-Chart js radar chart make axes thicker

1👍

Per the doco, you need to set:

For the ‘spokes’ of the chart:

options.scales.r.angleLines.lineWidth

And, for the lines connecting the ‘spokes’:

options.scales.r.grid.lineWidth

See below for an example:

var options = {
  elements: {
    line: {
      borderWidth: 3
    }
  },
  scales: {
    r: {
      grid: {
        lineWidth: 4
      },
      angleLines: {
        lineWidth: 6
      }
    }
  }
};

var myRadar = new Chart(ctx, {
  type: 'radar',
  data: ChartData,
  options: options
});
<div>
  <canvas id="myChart"></canvas>
</div>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
var ctx = document.getElementById('myChart');

var ChartData = {
  labels: [
    'Eating',
    'Drinking',
    'Sleeping',
    'Designing',
    'Coding',
    'Cycling',
    'Running'
  ],
  datasets: [{
    label: 'My First Dataset',
    data: [65, 59, 90, 81, 56, 55, 40],
    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)'
  }, {
    label: 'My Second Dataset',
    data: [28, 48, 40, 19, 96, 27, 100],
    fill: true,
    backgroundColor: 'rgba(54, 162, 235, 0.2)',
    borderColor: 'rgb(54, 162, 235)',
    pointBackgroundColor: 'rgb(54, 162, 235)',
    pointBorderColor: '#fff',
    pointHoverBackgroundColor: '#fff',
    pointHoverBorderColor: 'rgb(54, 162, 235)'
  }]
};
</script>

Leave a comment