Chartjs-Warning in chartjs/react-chartjs options assignment if setting type:'time'

4👍

Setting the type explicitly should get rid of the type error.

import {
  ChartOptions
} from "chart.js";

const options: ChartOptions<"line"> = { /* ... */ };

For more information check out FAQ in react-chartjs-2 docs.

Leave a comment