chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
609 stars 329 forks source link

Label on type box for 0.5.7 #804

Closed florincod closed 2 years ago

florincod commented 2 years ago

Hi,

There are any plans to add box type label for 0.5.7 version? Or can be done differently? image

stockiNail commented 2 years ago

@florincod no, there aren't. I'd suggest to go to version 2 where it has been implemented. Do you have any issue to go to version 2?

florincod commented 2 years ago

hmm kinda, it will take time. we do have a lot of charts(custom charts) and we are using "chart.js": "2.8.0".

stockiNail commented 2 years ago

I understand. I think the version 0.5.7 is quite obsoleted and it has some bugs (and missing features) solved (and implemented) starting from version 1, where the plugin has been completely rewritten. I don't see any possibility to release new version 0.

florincod commented 2 years ago

@stockiNail, I found a solution, with some adjustments you can do it with type: line which has label prop

stockiNail commented 2 years ago

You're right. you can position a line over the box and hide the line (borderWidth: 0 or borderColor: transparent, I guess).