Package org.jfree.chart.entity

Examples of org.jfree.chart.entity.StandardEntityCollection


   * @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


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

    int altura = 400;

   
    //armazena o mapa da figura para poder navegar no mesmo
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
   
        try {
      ChartUtilities.writeChartAsPNG(bytes, grafico , comp, altura, info);
    } catch (IOException ioe) {
      this.logger.info("Erro ao tentar gerar o gr�fico de realizado por exerc�cio");
View Full Code Here

      this.height = myChart.height;
      this.width = myChart.width;

      //armazena o mapa da figura para poder navegar no mesmo
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());

      try {
        ChartUtilities.writeChartAsPNG(bytes, grafico , myChart.width, myChart.height, info);
      } catch (IOException ioe) {
        this.logger.info("Erro ao tentar gerar o gr�fico de realizado por exerc�cio");
View Full Code Here

    // create temporary file names
    String[] tempFileInfo = createTempFile();
    String fileName = tempFileInfo[AbstractChartComponent.FILENAME_INDEX];
    String filePathWithoutExtension = tempFileInfo[AbstractChartComponent.FILENAME_WITHOUT_EXTENSION_INDEX];

    ChartRenderingInfo info = new ChartRenderingInfo( new StandardEntityCollection() );
    JFreeChartEngine.saveChart( chartDataDefinition, chartTitle,
        "", filePathWithoutExtension, width, height, JFreeChartEngine.OUTPUT_PNG, printWriter, info, this ); //$NON-NLS-1$
    applyOuterURLTemplateParam();
    populateInfo( info );
    Element chartElement = root.addElement( "chart" ); //$NON-NLS-1$
View Full Code Here

    // create temporary file names
    String[] tempFileInfo = createTempFile();
    String fileName = tempFileInfo[AbstractChartComponent.FILENAME_INDEX];
    String filePathWithoutExtension = tempFileInfo[AbstractChartComponent.FILENAME_WITHOUT_EXTENSION_INDEX];

    ChartRenderingInfo info = new ChartRenderingInfo( new StandardEntityCollection() );
    JFreeChartEngine.saveChart( chartDataDefinition, chartTitle,
        "", filePathWithoutExtension, width, height, JFreeChartEngine.OUTPUT_PNG, printWriter, info, this ); //$NON-NLS-1$
    applyOuterURLTemplateParam();
    populateInfo( info );
    Element chartElement = root.addElement( "chart" ); //$NON-NLS-1$
View Full Code Here

      // create temporary file names
      String[] tempFileInfo = createTempFile();
      String fileName = tempFileInfo[AbstractChartComponent.FILENAME_INDEX];
      String filePathWithoutExtension = tempFileInfo[AbstractChartComponent.FILENAME_WITHOUT_EXTENSION_INDEX];

      ChartRenderingInfo info = new ChartRenderingInfo( new StandardEntityCollection() );
      JFreeChartEngine.saveChart( chartDataDefinition, chartTitle,
          "", filePathWithoutExtension, width, height, JFreeChartEngine.OUTPUT_PNG, printWriter, info, this ); //$NON-NLS-1$
      applyOuterURLTemplateParam();
      populateInfo( info );
      Element chartElement = root.addElement( "chart" ); //$NON-NLS-1$
View Full Code Here

          }
          sbi.setShowAxis(options.getShow_axis())
          sbi.setThresholdValues(thresholdValues);
       
          JFreeChart chart = sbi.createChart();
          ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
          String requestIdentity = null;
          UUIDGenerator uuidGen  = UUIDGenerator.getInstance();
          UUID uuid = uuidGen.generateTimeBasedUUID();
          requestIdentity = uuid.toString();
          requestIdentity = requestIdentity.replaceAll("-", "");
          String path_param = requestIdentity;
          String dir=System.getProperty("java.io.tmpdir");
          String path=dir+"/"+requestIdentity+".png";
          java.io.File file1 = new java.io.File(path);
          logger.debug("Where is the image: "+path);
          try {
            ChartUtilities.saveChartAsPNG(file1, chart, 89, 11, info);
          } catch (IOException e) {
            e.printStackTrace();
            logger.error("Error in saving chart",e);
          }
          String urlPng=GeneralUtilities.getSpagoBiHost()+GeneralUtilities.getSpagoBiContext() + GeneralUtilities.getSpagoAdapterHttpUrl() +
          "?ACTION_NAME=GET_PNG2&NEW_SESSION=TRUE&path="+path_param+"&LIGHT_NAVIGATOR_DISABLED=TRUE";
          urlPng = "new java.net.URL(\""+urlPng+"\")";
          logger.debug("Image url: "+urlPng);
         
          image1.setAttribute("reportElement.y", yValue.toString());
          image1.setAttribute("reportElement.x", new Integer(310).toString());
          image1.setAttribute("reportElement.width", 90);
          SourceBean imageValue=(SourceBean)image1.getAttribute("imageExpression");
          imageValue.setCharacters(urlPng);
        }
        ThresholdValue tOfVal = line.getThresholdOfValue();
        if (tOfVal!=null && tOfVal.getPosition()!=null && tOfVal.getThresholdCode()!=null){
          String fileName ="position_"+tOfVal.getPosition().intValue();
          String dirName = tOfVal.getThresholdCode();
          String urlPng=GeneralUtilities.getSpagoBiHost()+GeneralUtilities.getSpagoBiContext() + GeneralUtilities.getSpagoAdapterHttpUrl() +
          "?ACTION_NAME=GET_THR_IMAGE&NEW_SESSION=TRUE&fileName="+fileName+"&dirName="+dirName+"&LIGHT_NAVIGATOR_DISABLED=TRUE"
         
          urlPng = "new java.net.URL(\""+urlPng+"\")";
          logger.debug("url: "+urlPng);
         
          extraimageToAdd=new SourceBean(image);
          extraimageToAdd.setAttribute("reportElement.y", yValue.toString());
          extraimageToAdd.setAttribute("reportElement.width",35);
          extraimageToAdd.setAttribute("reportElement.x", new Integer(408).toString());
          SourceBean imageValue=(SourceBean)extraimageToAdd.getAttribute("imageExpression");
          imageValue.setCharacters(urlPng);     
        }
      }else if(options.getDisplay_bullet_chart() && !options.getDisplay_threshold_image()){
        //only bullet chart has to be seen
        if ( kpiValue!=null &&  kpiValue.getValue()!= null && kpiValue.getThresholdValues()!=null && !kpiValue.getThresholdValues().isEmpty()) {

          List thresholdValues = kpiValue.getThresholdValues();     
          // String chartType = value.getChartType();
          String chartType = "BulletGraph";
          Double val = new Double(kpiValue.getValue());
          Double target = kpiValue.getTarget();
          ChartImpl sbi = ChartImpl.createChart(chartType);
          sbi.setValueDataSet(val);
          if (target != null) {
            sbi.setTarget(target);
          }
          sbi.setShowAxis(options.getShow_axis())
          sbi.setThresholdValues(thresholdValues);
         
          JFreeChart chart = sbi.createChart();
          ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
          String requestIdentity = null;
          UUIDGenerator uuidGen  = UUIDGenerator.getInstance();
          UUID uuid = uuidGen.generateTimeBasedUUID();
          requestIdentity = uuid.toString();
          requestIdentity = requestIdentity.replaceAll("-", "");
View Full Code Here

        EntityBlockParams ebp = null;
        BlockResult r = new BlockResult();
        if (params instanceof EntityBlockParams) {
            ebp = (EntityBlockParams) params;
            if (ebp.getGenerateEntities()) {
                EntityCollection ec = new StandardEntityCollection();
                LegendItemEntity entity = new LegendItemEntity(
                        (Shape) area.clone());
                entity.setSeriesIndex(this.series);
                entity.setSeriesKey(this.seriesKey);
                entity.setDataset(this.dataset);
                entity.setToolTipText(getToolTipText());
                entity.setURLText(getURLText());
                ec.add(entity);
                r.setEntityCollection(ec);
            }
        }
        return r;
    }
View Full Code Here

                 || position == RectangleEdge.RIGHT) {
            drawVertical(g2, area);
        }
        BlockResult result = new BlockResult();
        if (entity != null) {
            StandardEntityCollection sec = new StandardEntityCollection();
            sec.add(entity);
            result.setEntityCollection(sec);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.entity.StandardEntityCollection

Copyright © 2018 www.massapicom. 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.