[Chartjs]-ChartJS: add a clickable text in title

5👍

According to this issue on github.

There are two points mentioned:

1- You cannot have a hyperlink inside the canvas.

2- There is a solution to make title clickable but this makes whole one point to another point clickable not only text but the white space also.

My solution : what I did was to use a simple hack; I hide the title by giving it display :false and then add an external link to it. Line adding a link into the div. And upon clicking it I was changing the chart.

You can control the chart by using any external element but there are some limitation on manipulating the chart from the elements of the charts itself.

I hope it may help the future readers.

Leave a comment