score:8

Accepted answer

You can find example usages of chart.d.ts in the form of a tests file right next to the definition : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chart.js/chart.js-tests.ts

score:-1

A bit outdated question, but had similar request since I'm working with Angular + PrimeNG (which uses chart.js) with npm for packages.

Just install types from

npm i --save-dev @types/chart.js

and then use it for example:

import { Chart } from 'chart.js';
…
const myOptions: Chart.ChartOptions {
    title: {
      display: true,
      text: 'My title',
      fontSize: 16,
  },
}

Might help someone.


Related Query

More Query from same tag