Update tooltip custom label example#5454
Conversation
|
@jung35 can you build a jsfiddle with this change? |
|
I also added pointerevent none because you can't hover over data points with the tooltip blocking from hovering over data point here is example with |
docs/configuration/tooltip.md
Outdated
| tooltipEl.style.fontSize = tooltipModel.bodyFontSize + 'px'; | ||
| tooltipEl.style.fontStyle = tooltipModel._bodyFontStyle; | ||
| tooltipEl.style.padding = tooltipModel.yPadding + 'px ' + tooltipModel.xPadding + 'px'; | ||
| tooltipEl.style.pointerEvents = 'none'; |
There was a problem hiding this comment.
you used tabs here, but it's spaces everywhere else in the file
There was a problem hiding this comment.
oops, kinda made the change on github editor. defaulted to tabs
|
With var pos = this._chart.canvas.getBoundingClientRect();
var x = pos.left + window.pageXOffset;
var y = pos.top + window.pageYOffset;
// ...
el.style.left = x + tooltipModel.caretX + 'px';
el.style.top = y + tooltipModel.caretY + 'px';
// ...https://jsfiddle.net/r3Lz7371/16/ I think I prefer the |
|
|
|
I agree @simonbrunel @benmccann. Absolute is better to me |
|
@jung35 can you update to use |
The
canvas.getBoundingClientRect()So the tooltip should also reflect that as fixed positioning and not absolute