JfreeChart: Stacked Bar Chart and CategoryAxis showing dates

后端 未结 2 755
故里飘歌
故里飘歌 2020-12-02 03:08

I have created a stacked bar chart in which I show a count on the y axis and dates on the x axis. The problem is that when I have many dates on the x

2条回答
  •  执笔经年
    2020-12-02 03:27

    For a CategoryAxis, which is used the for the domain axis in a StackedBarChart, you have considerable flexility with the method setCategoryLabelPositions(). Typical usage is illustrated in the BarChartDemo1 source, shown here.

    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(
        CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    

提交回复
热议问题