moberwasserlechner / vaadin-chartjs

Vaadin 8 wrapper for ChartJS v2.x library
MIT License
56 stars 35 forks source link

Tooltips Cutoff - Seeking Example of Pie Chart Padding or Custom HTML Tooltip #93

Open matheso opened 5 years ago

matheso commented 5 years ago

I've been able to implement JS callbacks on the tooltips but can't figure out how to add padding to my overall pie chart. The tooltips are getting cut off on the top/bottom because there's no chart padding. I don't want to make the actual pie chart any larger though.

Referencing the exact issue solved here with Javascript, how do I implement the same layout padding in your Vaadin add-on?

Here's a similar solution on StackOverflow: link

I don't have the ability to rollout my own solution so am hoping I'm overlooking a feature. Otherwise, perhaps a custom tooltip is the solution?

The git commenter here indicates that the ideal solution is custom HTML tooltips outside the canvas, but I don't see any examples of this for your add-on either. There are tons of ChartJS docs but I don't know where to write the JS code inside my Java code, same as the chart layout/padding issue.

config.options() doesn't seem to have any 'layout' method at all.

Any feedback/code would be great, thank you.

NevenLiang commented 4 years ago

https://www.chartjs.org/docs/latest/configuration/layout.html