How to specify the position and layout of a JFreeChart chart legend

前端 未结 2 2057
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 08:58

I am using JFreeChart to render a stacked area chart. By default, the chart legend is rendered below the plot with the elements laid out horizontally. I would like the legend to

2条回答
  •  再見小時候
    2021-02-05 09:10

    Here is the equivalent for older versions:

        StandardLegend legend = new StandardLegend();
        legend.setPreferredWidth(100);
        legend.setAnchor(Legend.EAST);
        jfreechart.setLegend(legend);
    

提交回复
热议问题