Package org.jfree.chart.renderer.category

Examples of org.jfree.chart.renderer.category.CategoryItemRenderer


      domainAxis.setTickLabelPaint(tickLabel);
     
      domainAxis.setCategoryLabelPositions(
          CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
     
      CategoryItemRenderer rendrer = categoryPlot.getRenderer();
      for(int index = 0; index < colors.getSeries().size(); index++){
        rendrer.setSeriesPaint(index, new Color(colors.getSeries().get(index)));
      }
    }else if(plot instanceof PiePlot){
      PiePlot piePlot = (PiePlot)plot;
     
      piePlot.setSimpleLabels(visibility.isPieSimpleLabels());
View Full Code Here


  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    final CategoryPlot cpl = chart.getCategoryPlot();
    final CategoryItemRenderer renderer = cpl.getRenderer();
    if (StringUtils.isEmpty(getTooltipFormula()) == false)
    {
      renderer.setBaseToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula()));
    }
    if (StringUtils.isEmpty(getUrlFormula()) == false)
    {
      renderer.setBaseItemURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula()));
    }
    if (this.categoricalLabelFormat != null)
    {
      final StandardCategoryItemLabelGenerator scilg;
      if (categoricalLabelDecimalFormat != null)
      {
        scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat,
            new DecimalFormat(categoricalLabelDecimalFormat));
      }
      else if (categoricalLabelDateFormat != null)
      {
        scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat,
            new SimpleDateFormat(categoricalLabelDateFormat));
      }
      else
      {
        scilg = new StandardCategoryItemLabelGenerator(categoricalLabelFormat, new DecimalFormat());
      }
      renderer.setBaseItemLabelGenerator(scilg);
    }
    renderer.setBaseItemLabelsVisible(Boolean.TRUE.equals(getItemsLabelVisible()));
    if (getItemLabelFont() != null)
    {
      renderer.setBaseItemLabelFont(getItemLabelFont());
    }

    if (categoricalItemLabelRotation != null)
    {
      final ItemLabelPosition orgPosItemLabelPos = renderer.getBasePositiveItemLabelPosition();
      if (orgPosItemLabelPos == null)
      {
        final ItemLabelPosition pos2 = new ItemLabelPosition
            (ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER,
                TextAnchor.CENTER, categoricalItemLabelRotation.doubleValue());
        renderer.setBasePositiveItemLabelPosition(pos2);
      }
      else
      {
        final ItemLabelPosition pos2 = new ItemLabelPosition
            (orgPosItemLabelPos.getItemLabelAnchor(), orgPosItemLabelPos.getTextAnchor(),
                orgPosItemLabelPos.getRotationAnchor(), categoricalItemLabelRotation.doubleValue());
        renderer.setBasePositiveItemLabelPosition(pos2);
      }

      final ItemLabelPosition orgNegItemLabelPos = renderer.getBaseNegativeItemLabelPosition();
      if (orgNegItemLabelPos == null)
      {
        final ItemLabelPosition pos2 = new ItemLabelPosition
            (ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER,
                TextAnchor.CENTER, categoricalItemLabelRotation.doubleValue());
        renderer.setBaseNegativeItemLabelPosition(pos2);
      }
      else
      {
        final ItemLabelPosition neg2 = new ItemLabelPosition
            (orgNegItemLabelPos.getItemLabelAnchor(), orgNegItemLabelPos.getTextAnchor(),
                orgNegItemLabelPos.getRotationAnchor(), categoricalItemLabelRotation.doubleValue());
        renderer.setBaseNegativeItemLabelPosition(neg2);
      }
    }

    final Font labelFont = Font.decode(getLabelFont());


    final CategoryAxis categoryAxis = cpl.getDomainAxis();
    categoryAxis.setLabelFont(labelFont);
    categoryAxis.setTickLabelFont(labelFont);
    if (getCategoryTitleFont() != null)
    {
      categoryAxis.setLabelFont(getCategoryTitleFont());
    }
    if (getCategoryTickFont() != null)
    {
      categoryAxis.setTickLabelFont(getCategoryTickFont());
    }

    if (maxCategoryLabelWidthRatio != null)
    {
      categoryAxis.setMaximumCategoryLabelWidthRatio(maxCategoryLabelWidthRatio.floatValue());
    }
    cpl.setDomainGridlinesVisible(showGridlines);
    if (labelRotation != null)
    {
      categoryAxis.setCategoryLabelPositions
          (CategoryLabelPositions.createUpRotationLabelPositions(labelRotation.doubleValue()));
    }

    final String[] colors = getSeriesColor();
    for (int i = 0; i < colors.length; i++)
    {
      renderer.setSeriesPaint(i, parseColorFromString(colors[i]));
    }

    if (lowerMargin != null)
    {
      categoryAxis.setLowerMargin(lowerMargin.doubleValue());
View Full Code Here

    super.configureChart(chart);
    final CategoryPlot cpl = chart.getCategoryPlot();

    cpl.getDomainAxis().setCategoryMargin(0.0);

    final CategoryItemRenderer renderer = cpl.getRenderer();
    if ((isStacked()) && renderAsPercentages && (renderer instanceof StackedAreaRenderer))
    {
      final StackedAreaRenderer sbr = (StackedAreaRenderer) renderer;
      sbr.setRenderAsPercentages(true);
    }
View Full Code Here

    final CategoryDataset linesDataset = createLinesDataset();

    //Create the renderer with the barchart, use a different bar renderer depending
    //if 3D chart or not
    final CategoryPlot plot = chart.getCategoryPlot();
    final CategoryItemRenderer lineRenderer;
    if (isThreeD())
    {
      lineRenderer = new LineRenderer3D();
    }
    else
View Full Code Here

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);
    final CategoryPlot cpl = chart.getCategoryPlot();
    final CategoryItemRenderer renderer = cpl.getRenderer();
    final BarRenderer br = (BarRenderer) renderer;
    br.setDrawBarOutline(isChartSectionOutline());
    if (maxBarWidth != null)
    {
      br.setMaximumBarWidth(maxBarWidth.doubleValue());
View Full Code Here

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    final CategoryPlot cpl = chart.getCategoryPlot();
    final CategoryItemRenderer renderer = cpl.getRenderer();
    renderer.setStroke(translateLineStyle(lineWidth, lineStyle));
    if (renderer instanceof LineAndShapeRenderer)
    {
      final LineAndShapeRenderer shapeRenderer = (LineAndShapeRenderer) renderer;
      shapeRenderer.setShapesVisible(isMarkersVisible());
      shapeRenderer.setBaseShapesFilled(isMarkersVisible());
View Full Code Here

    super.configurePlot(plot, jrPlot);

    if(plot instanceof CategoryPlot)
    {
      CategoryPlot categoryPlot = (CategoryPlot)plot;
      CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
      CategoryDataset categoryDataset = categoryPlot.getDataset();
      if(categoryDataset != null)
      {
        for(int i = 0; i < categoryDataset.getRowCount(); i++)
        {
          categoryRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
        }
      }
      categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_217);
      categoryPlot.setRangeGridlineStroke(new BasicStroke(0.5f));
      categoryPlot.setDomainGridlinesVisible(false);
View Full Code Here

//    JRBarPlot barPlot = (BarPlot)categoryPlot;
//    categoryPlot.getDomainAxis().setTickLabelsVisible(
//        categoryPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().
//        true
//        );
    CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelsVisible(true);
    BarRenderer barRenderer = (BarRenderer)categoryRenderer;
    List seriesPaints = (List)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.SERIES_COLORS);
    barRenderer.setSeriesPaint(0, (Paint)seriesPaints.get(3));
    barRenderer.setSeriesPaint(1, (Paint)seriesPaints.get(0));
    CategoryDataset categoryDataset = categoryPlot.getDataset();
View Full Code Here

    if(plotOrientation != null)
    {
      p.setOrientation(plotOrientation);
    }
   
    CategoryItemRenderer categoryRenderer = p.getRenderer();
    Paint[] paintSequence = getPaintSequence(plotSettings, jrPlot)
    if(paintSequence != null)
    {
      for(int i = 0; i < paintSequence.length; i++)
      {
        categoryRenderer.setSeriesPaint(i, paintSequence[i]);
      }
    }
    Paint[] outlinePaintSequence = getOutlinePaintSequence(plotSettings)
    if(outlinePaintSequence != null)
    {
      for(int i = 0; i < outlinePaintSequence.length; i++)
      {
        categoryRenderer.setSeriesOutlinePaint(i, outlinePaintSequence[i]);
      }
    }
    Stroke[] strokeSequence = getStrokeSequence(plotSettings);
    if(strokeSequence != null)
    {
      for(int i = 0; i < strokeSequence.length; i++)
      {
        categoryRenderer.setSeriesStroke(i, strokeSequence[i]);
      }
    }
    Stroke[] outlineStrokeSequence = getOutlineStrokeSequence(plotSettings);
    if(outlineStrokeSequence != null)
    {
      for(int i = 0; i < outlineStrokeSequence.length; i++)
      {
        categoryRenderer.setSeriesOutlineStroke(i, outlineStrokeSequence[i]);
      }
    }
   
    Boolean domainGridlineVisible = plotSettings.getDomainGridlineVisible();
    if(domainGridlineVisible == null || domainGridlineVisible.booleanValue())
View Full Code Here

  {
    super.configurePlot(plot, jrPlot);
    if(plot instanceof CategoryPlot)
    {
      CategoryPlot categoryPlot = (CategoryPlot)plot;
      CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
      CategoryDataset categoryDataset = categoryPlot.getDataset();
      if(categoryDataset != null)
      {
        for(int i = 0; i < categoryDataset.getRowCount(); i++)
        {
          categoryRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
        }
      }
      categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_134);
      categoryPlot.setRangeGridlineStroke(new BasicStroke(1f));
      categoryPlot.setDomainGridlinesVisible(false);
View Full Code Here

TOP

Related Classes of org.jfree.chart.renderer.category.CategoryItemRenderer

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.