Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

amCharts 5: Is is possible to rotate axes tick labels?

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.

like image 246
lukebm Avatar asked Oct 27 '25 14:10

lukebm


1 Answers

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

like image 150
lukebm Avatar answered Oct 30 '25 09:10

lukebm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!