Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

React-chartjs-2でレーダーチャートのラベルの色を変える

解決したいこと

Reactでreact-chartjs-2を使ってレーダーチャートを表示して、指定した位置のラベルの色を変更したいのですがその方法がわかりません。
以下のコードでいうと「Thing1」と「Thing4」だけを赤文字にするなどの処理をしたいのですが何か方法はありませんでしょうか。

export const data = {
  labels: ['Thing 1', 'Thing 2', 'Thing 3', 'Thing 4', 'Thing 5', 'Thing 6'],
  datasets: [
    {
      label: '# of Votes',
      data: [2, 9, 3, 5, 2, 3],
      backgroundColor: 'rgba(255, 99, 132, 0.2)',
      borderColor: 'rgba(255, 99, 132, 1)',
      borderWidth: 1,
    },
  ],
};

export function App() {
  return <Radar data={data} />;
}

無題.png

自分で試したこと

Radarのoptionsに以下のようにしてみたのですが駄目でした。

<Radar
    data={data}
    options={
        color: [
            'red',
            'blue',
            'green',
            'black'
        ]
    }
/>
0 likes

No Answers yet.

Your answer might help someone💌