Search in sources :

Example 1 with PropertyException

use of org.krysalis.jcharts.properties.PropertyException in project activityinfo by bedatadriven.

the class ChartRendererJC method renderImage.

public BufferedImage renderImage(PivotChartReportElement element, boolean includeTitle, int width, int height, int dpi) {
    try {
        Chart chart = createChart(element, includeTitle, width, height, dpi);
        BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        chart.setGraphics2D(bufferedImage.createGraphics());
        chart.render();
        return bufferedImage;
    } catch (IOException e) {
        throw new ReportModelException(e, element);
    } catch (ChartDataException e) {
        throw new ReportModelException(e, element);
    } catch (PropertyException e) {
        throw new ReportModelException(e, element);
    }
}
Also used : ReportModelException(org.activityinfo.shared.exception.ReportModelException) PropertyException(org.krysalis.jcharts.properties.PropertyException) ChartDataException(org.krysalis.jcharts.chartData.ChartDataException) IOException(java.io.IOException) AxisChart(org.krysalis.jcharts.axisChart.AxisChart) Chart(org.krysalis.jcharts.Chart) BufferedImage(com.google.code.appengine.awt.image.BufferedImage)

Aggregations

BufferedImage (com.google.code.appengine.awt.image.BufferedImage)1 IOException (java.io.IOException)1 ReportModelException (org.activityinfo.shared.exception.ReportModelException)1 Chart (org.krysalis.jcharts.Chart)1 AxisChart (org.krysalis.jcharts.axisChart.AxisChart)1 ChartDataException (org.krysalis.jcharts.chartData.ChartDataException)1 PropertyException (org.krysalis.jcharts.properties.PropertyException)1