How do I rotate tick mark labels on the domain of a number axis in JFreeChart?

前端 未结 3 859
迷失自我
迷失自我 2020-11-28 14:40

Just like is being done in the following example, I want the tick mark labels on the domain of chart to be rotated 45 degrees as the are in this chart: http://left.subtree.o

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 15:27

    The first answer given is for a numeric domain axis. If you have a category axis, you want this code:

    CategoryAxis domainAxis = plot.getDomainAxis();  
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);  
    

提交回复
热议问题