4

Is is possible to rotate axes tick labels in amCharts 5? E.g.

enter image description here

I am unable to find this mentioned anywhere in the new amCharts 5 documentation. This was possible in amCharts 4.

xorspark
  • 15,749
  • 2
  • 29
  • 38
lukebm
  • 163
  • 11

1 Answers1

3

This can be achieved by setting the rotation property on the relevant axis-renderer's labels.template, eg:

//...
const xAxisRenderer = am5xy.AxisRendererX.new(root, {});

xAxisRenderer.labels.template.setAll({
  rotation: -45,
});

const xAxis = chart.xAxes.push(
  am5xy.CategoryAxis.new(root, {
    renderer: xAxisRenderer ,
    categoryField: 'category-name-here',
  })
);
//...

Found via: amCharts 5 demo

lukebm
  • 163
  • 11