[Chartjs]-TypeScript issue How to pass parameters in a custom plugin for Chart.js and react-chartjs-2

2👍

You need to extend chart.js typings by creating your own index.d.ts file and put the following in it:

import {ChartType, Plugin} from 'chart.js';

declare module 'chart.js' {
  interface PluginOptionsByType<TType extends ChartType> {
    horizontalArbitraryLine?: {
      lineColor: string
    };
  }
}

Leave a comment