Search in sources :

Example 1 with ChartRendererJC

use of org.activityinfo.server.report.renderer.ChartRendererJC in project activityinfo by bedatadriven.

the class PPTChartRenderer method render.

public void render(PivotChartReportElement element, SlideShow ppt) throws IOException {
    // add first slide
    Slide slide = ppt.createSlide();
    // define position of the drawing in the slide
    Dimension pageSize = ppt.getPageSize();
    Dimension chartSize = new Dimension((int) (pageSize.getWidth() - 72), (int) (pageSize.getHeight() - 183));
    Rectangle bounds = new com.google.code.appengine.awt.Rectangle(new Point(36, 126), chartSize);
    ShapeGroup group = new ShapeGroup();
    group.setAnchor(bounds);
    slide.addShape(group);
    Graphics2D graphics = new PPGraphics2D(group);
    ChartRendererJC jc = new ChartRendererJC();
    jc.render(element, false, graphics, (int) chartSize.getWidth(), (int) chartSize.getHeight(), 72);
}
Also used : PPGraphics2D(org.apache.poi.hslf.model.PPGraphics2D) ChartRendererJC(org.activityinfo.server.report.renderer.ChartRendererJC) Slide(org.apache.poi.hslf.model.Slide) Rectangle(com.google.code.appengine.awt.Rectangle) Dimension(com.google.code.appengine.awt.Dimension) Point(com.google.code.appengine.awt.Point) ShapeGroup(org.apache.poi.hslf.model.ShapeGroup) PPGraphics2D(org.apache.poi.hslf.model.PPGraphics2D) Graphics2D(com.google.code.appengine.awt.Graphics2D)

Aggregations

Dimension (com.google.code.appengine.awt.Dimension)1 Graphics2D (com.google.code.appengine.awt.Graphics2D)1 Point (com.google.code.appengine.awt.Point)1 Rectangle (com.google.code.appengine.awt.Rectangle)1 ChartRendererJC (org.activityinfo.server.report.renderer.ChartRendererJC)1 PPGraphics2D (org.apache.poi.hslf.model.PPGraphics2D)1 ShapeGroup (org.apache.poi.hslf.model.ShapeGroup)1 Slide (org.apache.poi.hslf.model.Slide)1