List of usage examples for org.jfree.chart.title LegendTitle getHeight
public double getHeight()
From source file:org.n52.oxf.render.sos.TimeSeriesChartRenderer4xPhenomenons.java
/** * The resulting IVisualization shows a chart which consists a TimeSeries for each FeatureOfInterest * contained in the observationCollection. *//*w w w .j a v a 2 s.co m*/ public IVisualization renderChart(OXFFeatureCollection observationCollection, ParameterContainer paramCon, int width, int height) { JFreeChart chart = renderChart(observationCollection, paramCon); // draw plot into image: Plot plot = chart.getPlot(); BufferedImage chartImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D chartGraphics = chartImage.createGraphics(); chartGraphics.setColor(Color.white); chartGraphics.fillRect(0, 0, width, height); plot.draw(chartGraphics, new Rectangle2D.Float(0, 0, width, height), null, null, null); // draw legend into image: LegendTitle legend = chart.getLegend(); BufferedImage legendImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D legendGraphics = legendImage.createGraphics(); legendGraphics.setColor(Color.white); legendGraphics.fillRect(0, 0, (int) legend.getWidth(), (int) legend.getHeight()); legend.draw(legendGraphics, new Rectangle2D.Float(0, 0, width, height)); return new StaticVisualization(chartImage, legendImage); }