ng2-charts icon indicating copy to clipboard operation
ng2-charts copied to clipboard

Documentation of line chart lacks info on registering AnnotationPlugin

Open aljoshakoecher opened this issue 2 years ago • 1 comments

I tried to setup a line chart as described in https://valor-software.com/ng2-charts/#LineChart. Unfortunately, I couldn't get the chart to render as there was a problem with the annotation plugin. The chart was only displayed once I removed the annotation. I then discovered that the AnnotationPlugin needs to be registered as described here https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/integration.html. The line Chart.register(AnnotationPlugin) did it for me.

This should be added to the example in the docs, or what do you think?

aljoshakoecher avatar May 18 '22 11:05 aljoshakoecher

@aljoshakoecher Definitely worth adding, I've just spent hours trying to get it to work until I saw your post.

asad-c avatar Jun 09 '22 21:06 asad-c

Yeah I faced the same issue and spent hours figuring out untill I saw the documentation page of that plugin. Duplicate of #1357

AndeYashwanth avatar Nov 26 '22 13:11 AndeYashwanth

The Chart.register call is present in the example docs

santam85 avatar Mar 01 '24 16:03 santam85