Currently xAlign property for tooltip has three different variables: left, right and center. But such realisation is not very flexible and gives little control on tooltip allignment.
Current Behavior
Currently with this config I can make tooltip to align automatically:
tooltips: { mode: 'index', intersect: false, yAlign: 'center', ... }
But when tooltip as xAlign-ed to center it covers the current data points beneath it so they are not visible. It's not very handy, because I want to see the points position that I have selected.

Current options for xAlign - left and right stick the position of the tooltip, but it becomes cropped if hovered on left- or right-most parts of the canvas.
Expected Behavior
It would be better if tooltip had more adjustable alignment facility so that selected points were not hidden by the tooltip and were positioned whether to right or to left from the selected data points if area of chart allows it.
Possible Solution
The more or less working solution I've found so far is this on SO . But those guys suggest total copy-paste from chart.js tooltip source and monkey-patch it through plugin system, which needs a lot code duplication - only to alter the determineAlignment function I need to fetch all tooltip's code.
Possible solutions can be
- Allow to modify
determineAlignment function with chart.js options API
- Adding additional
xAlign variants like floatLeft and floatRight to suggest the tooltip on how to align oneself, and if it's not possible to align left or rigth without cropping it - than alignment goes on auto mode (as it's now)
Any comments are valueable, thank you!
Currently
xAlignproperty for tooltip has three different variables: left, right and center. But such realisation is not very flexible and gives little control on tooltip allignment.Current Behavior
Currently with this config I can make tooltip to align automatically:
tooltips: { mode: 'index', intersect: false, yAlign: 'center', ... }But when tooltip as xAlign-ed to center it covers the current data points beneath it so they are not visible. It's not very handy, because I want to see the points position that I have selected.
Current options for
xAlign- left and right stick the position of the tooltip, but it becomes cropped if hovered on left- or right-most parts of the canvas.Expected Behavior
It would be better if tooltip had more adjustable alignment facility so that selected points were not hidden by the tooltip and were positioned whether to right or to left from the selected data points if area of chart allows it.
Possible Solution
The more or less working solution I've found so far is this on SO . But those guys suggest total copy-paste from chart.js tooltip source and monkey-patch it through plugin system, which needs a lot code duplication - only to alter the
determineAlignmentfunction I need to fetch all tooltip's code.Possible solutions can be
determineAlignmentfunction with chart.js options APIxAlignvariants likefloatLeftandfloatRightto suggest the tooltip on how to align oneself, and if it's not possible to align left or rigth without cropping it - than alignment goes on auto mode (as it's now)Any comments are valueable, thank you!