[Chartjs]-Error with Chartjs radar pointLabels color Scriptable

1👍

This is currently a bug in chart.js. It generates the context for the labels on the size of the ticks array so as a workaround you can specify the count in the ticks array to be the same size as the amount of pointLabels you have

scales: {
    r: {
        ticks: {
            count: 24
        },
        pointLabels: {
            color: (ctx) => {
                return ctx.index % 2 === 0 ? 'green' : 'red'
            }
        }
    }
}

Example: https://codepen.io/leelenaleee/pen/PomZgoW

Leave a comment