chartjs-plugin-annotations not displayed in angular 5

前端 未结 4 1527
名媛妹妹
名媛妹妹 2021-01-06 00:10

While using the chart.js and the plugin chartjs-plugin-annotation, annotations are not showing while using angular 5, no error messages are displayed.

I have created

4条回答
  •  青春惊慌失措
    2021-01-06 01:01

    To anyone having a TypeScript error saying that annotation isn't a ChartOptions property. After looking for an answer for a week or two I found a way to fix the issue.

    Follow this path: node_modules/@types/chart.js/index.d.ts

    Open index.d.ts, locate interface ChartOptions { and add this line. annotation?: Object; }

    This is how I fixed my issue after every other solution failed.

提交回复
热议问题