I am using JFreeChart 0.9.14.
How can I set 10 pixels padding display on the inner border before text/plot begins?
I have tried the JFreeChart's setBorder function
But it just add a border on the top of the text/plot.
Code: Select all
chart.setBorderVisible(true);
chart.setBorderStroke(new BasicStroke(10));
chart.setBorderPaint(java.awt.Color.green);
Code: Select all
//Insets(int top, int left, int bottom, int right)
chart.getPlot().setInsets(new Insets(0, 0, 0, 10));
plot.getRangeAxis().setLabelInsets(new Insets(10, 0, 0, 0));
//Spacer(int type, double left, double top, double right, double bottom)
chart.getTitle().setSpacer(new Spacer(Spacer.ABSOLUTE, 0, 10, 0, 0));
chart.getSubtitle(0).setSpacer(new Spacer(Spacer.ABSOLUTE, 10, 0, 0, 10));
chart.getSubtitle(1).setSpacer(new Spacer(Spacer.ABSOLUTE, 10, 0, 0, 0));
chart.getSubtitle(2).setSpacer(new Spacer(Spacer.ABSOLUTE, 10, 0, 0, 0));
and this code is very tedious for future code maintenance.
Is there any better function/method to do it?
Thanks