Skip to content

Can custom annotations be made? #936

Closed Answered by stockiNail
anhln1998 asked this question in Q&A
Discussion options

You must be logged in to vote

@anhln1998 there is not any support for custom annotation. This was evaluated a couple of years ago but was discarded.

To do what you are showing, I would implement a label annotation setting a canvas as content (https://www.chartjs.org/chartjs-plugin-annotation/latest/samples/label/canvas.html).
The label annotation could have text, image or canvas content.
You could create a a canvas (pay attention to the dimension), you can draw the shape you want and you can set it to the label annotation (content option).
There are other specific option to act on canvas (like width, height).

Otherwise, if too complex, I would implement a specific ChartJS plugin to do that.
Hopefully this could help you.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@anhln1998
Comment options

Answer selected by stockiNail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants