This is a demo tutorial. While there is no step-by-step commentary available (yet), the live demo below is fully functional. Feel free to open it for full source code.
This demo shows how we can use an adapter to change the orientation of a ColumnSeries
tooltip based on the column value.
Related code
The following code will change value of tooltip's pointerOrientation
to either point down or up based on whether target column's value is above or below zero.
series.get("tooltip").adapters.add("pointerOrientation", function(orientation, target) { return target.dataItem && target.dataItem.get("valueY") < 0 ? "up": orientation; });
series.get("tooltip").adapters.add("pointerOrientation", function(orientation, target) { return target.dataItem && target.dataItem.get("valueY") < 0 ? "up": orientation; });
Demo
See the Pen Adaptive tooltip orientation based on value by amCharts team (@amcharts) on CodePen.