Customize subtitle position - JFreeChart

2020-02-13 05:20发布

I want to know if it is possible to put a JFreeChart subtitle in the bottom of the chart, under the chart, and not under the Title.

What I want to do is illustrated on these images:

actual http://i.stack.imgur.com/AmPJ8.jpg

and

desired http://i.stack.imgur.com/VBfvL.jpg.

I just tried almost everything and cannot do this.

I am using subtitle insted of legend, because legend is presented with a red square, indicating the color of the series shown on the graphics.

Thanks in advance!

Joey

1条回答
兄弟一词,经得起流年.
2楼-- · 2020-02-13 05:41

In this example, the following TextTitle appears to work.

chart.addSubtitle(new TextTitle(new Date().toString(),
    new Font("Dialog", Font.ITALIC, 14), Color.black,
    RectangleEdge.BOTTOM, HorizontalAlignment.CENTER,
    VerticalAlignment.BOTTOM, RectangleInsets.ZERO_INSETS));

enter image description here

查看更多
登录 后发表回答