Tooltip with a pointer on the side

This demo shows how we can use an adapter to dynamically update tooltip bounds, so that tooltip pointer is attached to its left side, rather than in the middle.

Code

tooltip.adapters.add("bounds", function(bounds, target) {
  if (bounds) {
    bounds.left = target.get("pointTo").x - 20;
  }
  return bounds;
});
tooltip.adapters.add("bounds", function(bounds, target) {
  if (bounds) {
    bounds.left = target.get("pointTo").x - 20;
  }
  return bounds;
});

Demo

See the Pen
Tooltip with a pointer moved to the side
by amCharts team (@amcharts)
on CodePen.0

Posted in Uncategorized