[Chartjs]-How to work out Chartjs using TypeScript with Chartjs.definitelyTyped from github

9๐Ÿ‘

โœ…

You can find example usages of chart.d.ts in the form of a tests file right next to the definition in the DefinitelyTyped repo.

3๐Ÿ‘

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.

Leave a comment