Search code examples
javascriptamcharts

Label rotation in amCharts not working properly


I need to rotate the x-axis labels 45 degrees. What I did is as below:

I have added chart.labelRotation =45

fiddle

It is not working!


Solution

  • labelRotation is a property of categoryAxis, not chart's property. So you need to apply it to chart.categoryAxis:

    chart.categoryAxis.labelRotation = 45;
    

    Here's your updated fiddle.