Examples of ChartRenderingInfo


Examples of org.jfree.chart.ChartRenderingInfo

                xAxis.setLabelFont(xAxis.getLabelFont().deriveFont(fontSize));
            if (yAxis != null)
                yAxis.setLabelFont(yAxis.getLabelFont().deriveFont(fontSize));
        } catch (Exception afs) {}

        ChartRenderingInfo info =
                (isHtmlMode() ? new ChartRenderingInfo() : null);
        BufferedImage img = new BufferedImage
            (width, height, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = img.createGraphics();
        if ("auto".equals(getSetting("titleFontSize")))
            maybeAdjustTitleFontSize(chart, g2, width);
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

   * @throws CewolfException
   */
  private static RenderedImage renderChart(ChartImage cd, Object chart) throws CewolfException {
    try {
      final ByteArrayOutputStream baos = new ByteArrayOutputStream();
      final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
      final String mimeType = cd.getMimeType();
      if (MIME_PNG.equals(mimeType)) {
        handlePNG(baos, (JFreeChart)chart, cd.getWidth(), cd.getHeight(), info);
      } else if (MIME_JPEG.equals(mimeType)) {
          handleJPEG(baos, (JFreeChart)chart, cd.getWidth(), cd.getHeight(), info);
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

      // chart in the state we received it.
      if (!haslegend) {
        removeLegend(chart);
      }

      return new RenderedImage(out.toByteArray(), "image/jpeg", new ChartRenderingInfo(new StandardEntityCollection()));
    } catch (IOException ioex) {
      log.error("Renderer.renderLegend: "+ioex.getMessage());
      throw new ChartRenderingException(ioex.getMessage(), ioex);
    }
  }
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

      String mapTagContent = "<" + MAP_TAGNAME;
      mapTagContent += " " + NAME_ATTRIBUTE + "=\"" + chartId + "\"";
      mapTagContent += " " + ID_ATTRIBUTE + "=\"" + chartId + "\"";
      mapTagContent += " >";
      out.write(mapTagContent);
      ChartRenderingInfo info = (ChartRenderingInfo) root.getRenderingInfo();
      Iterator entities = info.getEntityCollection().iterator();
      boolean altAttrbInserted, hasContent;
      StringBuffer sb = new StringBuffer(200);
      while (entities.hasNext()) {
        altAttrbInserted = false;
        hasContent = false;
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

        }

        chart.setBackgroundPaint(java.awt.Color.white);

        try {
            final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
            ChartUtilities.saveChartAsPNG(tempTestSummaryFile, chart, 600, 400, info);
        } catch (IOException e) {
            logger.error("Problem saving png chart", e);
        }
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

    if (chart == null) return null;   
   
    chart.setBackgroundPaint(Color.WHITE);
   
    ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());

    BufferedImage bufferedImage =  chart.createBufferedImage(reportChart.getWidth(), reportChart.getHeight(),info);
    byte[] image = null;
   
    try
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

            if (this.regionEnd != null) {
                endpoint = this.chartPanel.translateScreenToJava2D(this.regionEnd);
            }

            ChartRenderingInfo info = this.chartPanel.getChartRenderingInfo();
            Rectangle2D dataArea = info.getPlotInfo().getDataArea();
            ValueAxis domainAxis = this.renderer.getPlot().getDomainAxis();
            RectangleEdge edge = this.renderer.getPlot().getDomainAxisEdge();

            // define the limits for the region to be shaded
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

        } else if (this.currentMouseMode == MOUSEMODE.PICKPEAK) {

            this.renderer.getPlot().setDomainCrosshairVisible(false);
            this.renderer.getPlot().clearDomainMarkers();
            Point2D point = this.chartPanel.translateScreenToJava2D(e.getPoint());
            ChartRenderingInfo info = this.chartPanel.getChartRenderingInfo();
            Rectangle2D dataArea = info.getPlotInfo().getDataArea();
            ValueAxis domainAxis = this.renderer.getPlot().getDomainAxis();
            RectangleEdge edge = this.renderer.getPlot().getDomainAxisEdge();

            // define the point for the peaks
            double peakPoint = domainAxis.java2DToValue(point.getX(), dataArea, edge);
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

    protected static String writeImageMap(JFreeChart chart, OutputElement outputElement, HttpSession session, PrintWriter pw) {
        String filename;
        try {
            //  Write the chart image to the temporary directory
            ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
            filename = ServletUtilities.saveChartAsPNG(chart,
                    outputElement.getChart().getWidth().intValue(),
                    outputElement.getChart().getHeight().intValue(),
                    info, session);
View Full Code Here

Examples of org.jfree.chart.ChartRenderingInfo

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        ChartRenderingInfo i1 = new ChartRenderingInfo();
        ChartRenderingInfo i2 = new ChartRenderingInfo();
        assertTrue(i1.equals(i2));

        i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
        assertFalse(i1.equals(i2));
        i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
        assertTrue(i1.equals(i2));

        i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
        assertFalse(i1.equals(i2));
        i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
        assertTrue(i1.equals(i2));

        StandardEntityCollection e1 = new StandardEntityCollection();
        e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
        i1.setEntityCollection(e1);
        assertFalse(i1.equals(i2));
        StandardEntityCollection e2 = new StandardEntityCollection();
        e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
        i2.setEntityCollection(e2);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.