With the help of our jfree members i have created a dual axis chart.But i faced a problem that i am trying to change the font size,font type of label,tick units but i got only one left axis values changed according to the font type and size and set by me,other axis(right side doesn't get changed).
Code: Select all
final JFreeChart chart = new JFreeChart("Unbilled Milestones Chart", plot);
chart.setBackgroundPaint(Color.white);
//chart.getLegend().setAnchor(Legend.SOUTH);
plot.setBackgroundPaint(new Color(0xEE, 0xEE, 0xFF));
plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
plot.setDataset(1, dataset2);
plot.mapDatasetToRangeAxis(1, 1);
final Font f=new Font("Diagram", Font.BOLD, 11);
final ValueAxis axis2 = new NumberAxis("Amount");
plot.setRangeAxis(1, axis2);
rangeAxis.setUpperBound(15);
plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
final BarRenderer renderer2 = new BarRenderer();
plot.setRenderer(1, renderer2);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
final Font f=new Font("Diagram", Font.BOLD, 11);
plot.getDomainAxis().setLabelFont(f);
plot.getDomainAxis().setTickLabelFont(f);
plot.getRangeAxis().setLabelFont(f);
plot.getRangeAxis().setTickLabelFont(f);
I am really happy if i got the solution
Regards,
Vairamuthu M
Code: Select all
Code: Select all
Code: Select all
Code: Select all
Code: Select all