public static JFreeChart createJFreeChart(String title, XYPlot result, int imageHeight) {
JFreeChart chart = new JFreeChart(title, result);
chart.getLegend().setPosition(RectangleEdge.TOP);
chart.getLegend().setHorizontalAlignment(HorizontalAlignment.LEFT);
chart.getLegend().setFrame(BlockBorder.NONE);
chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, imageHeight, new Color(229, 236, 246)));
chart.getTitle().setFont(new Font("SansSerif", Font.PLAIN | Font.BOLD, 16));
chart.getTitle().setPaint(Color.GRAY);
return chart;
}
}