Hi,
i) How do i control the Font(Size) of X and Y Coordinates.,i have managed to found only font to set for the Title of JKFreeChart.
11) how do to control the Space between the Frame Title to the Titke Of the Chart, Frame Bottom to the Test Data Label., X-axes Co-ordinates to X-axes label.
Thanks,
Kishore.
How to Control Font(X,Y co-ords),Space between components!
Re: How to Control Font(X,Y co-ords),Space between component
Kishore wrote:
> i) How do i control the Font(Size) of X and Y Coordinates.,i
> have managed to found only font to set for the Title of
> JKFreeChart.
Use the setTickLabelFont(...) method in the Axis class:
XYPlot plot = myChart.getXYPlot();
Axis xAxis = plot.getDomainAxis();
Axis yAxis = plot.getRangeAxis();
xAxis.setTickLabelFont(font1);
yAxis.setTickLabelFont(font2);
> 11) how do to control the Space between the Frame Title to
> the Titke Of the Chart, Frame Bottom to the Test Data Label.,
> X-axes Co-ordinates to X-axes label.
You can increase the space around the title using the setSpacer(...) method in the AbstractTitle class:
AbstractTitle title = myChart.getTitle(0);
title.setSpacer(new Spacer(...));
The Legend class has an attribute 'outerGap' that controls the amount of space around the outside of the legend. Unfortunately, this can only be set in the constructor. I'll probably modify this to use a Spacer object, in the same way as AbstractTitle.
The setTickLabelInsets(...) method in the Axis class controls the amount of space around the outside of the tick labels.
Regards,
DG.
> i) How do i control the Font(Size) of X and Y Coordinates.,i
> have managed to found only font to set for the Title of
> JKFreeChart.
Use the setTickLabelFont(...) method in the Axis class:
XYPlot plot = myChart.getXYPlot();
Axis xAxis = plot.getDomainAxis();
Axis yAxis = plot.getRangeAxis();
xAxis.setTickLabelFont(font1);
yAxis.setTickLabelFont(font2);
> 11) how do to control the Space between the Frame Title to
> the Titke Of the Chart, Frame Bottom to the Test Data Label.,
> X-axes Co-ordinates to X-axes label.
You can increase the space around the title using the setSpacer(...) method in the AbstractTitle class:
AbstractTitle title = myChart.getTitle(0);
title.setSpacer(new Spacer(...));
The Legend class has an attribute 'outerGap' that controls the amount of space around the outside of the legend. Unfortunately, this can only be set in the constructor. I'll probably modify this to use a Spacer object, in the same way as AbstractTitle.
The setTickLabelInsets(...) method in the Axis class controls the amount of space around the outside of the tick labels.
Regards,
DG.