Left-aligning vertical axis labels

Normally, the labels of the vertical left-side axis are right aligned. This demo will show how we can easily make them left-aligned instead.

Code

To make labels left-aligned, it's enough to just override their horizontal center to their left:

yAxis.get("renderer").labels.template.setAll({
  centerX: am5.p0
});
yAxis.get("renderer").labels.template.setAll({
  centerX: am5.p0
});

Demo

See the Pen Left-aligned labels on a vertical axis by amCharts team (@amcharts) on CodePen.

Posted in Uncategorized