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

前端 未结 2 2093
爱一瞬间的悲伤
爱一瞬间的悲伤 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:18

    A little more time examining the API would have given me the answer:

    LegendTitle legend = chart.getLegend();
    legend.setPosition(RectangleEdge.RIGHT);
    

提交回复
热议问题