Examples of CategoryPlot


Examples of org.jfree.chart.plot.CategoryPlot

        t.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        t.setMargin(4.0, 0.0, 2.0, 4.0);
        chart.addSubtitle(t);

        // get a reference to the plot for further customisation...
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        LegendItemCollection items = new LegendItemCollection();
        items.add(new LegendItem("Against all torture", null, null, null,
                new Rectangle2D.Double(-6.0, -3.0, 12.0, 6.0), Color.green));
        items.add(new LegendItem("Some degree permissible", null, null, null,
                new Rectangle2D.Double(-6.0, -3.0, 12.0, 6.0), Color.red));
        plot.setFixedLegendItems(items);
        plot.setInsets(new RectangleInsets(5, 5, 5, 20));
        LegendTitle legend = new LegendTitle(plot);
        legend.setPosition(RectangleEdge.BOTTOM);
        chart.addSubtitle(legend);
       
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setDomainGridlinesVisible(true);
        plot.setRangeGridlinePaint(Color.white);
       
        // set the range axis to display integers only...
        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        rangeAxis.setUpperMargin(0.0);
       
        // disable bar outlines...
        BarRenderer renderer = (BarRenderer) plot.getRenderer();
        renderer.setDrawBarOutline(false);
       
        // set up gradient paints for series...
        GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
        Paint gp1 = new Color(0, 0, 0, 0);
View Full Code Here

Examples of org.jfree.chart.plot.CategoryPlot

      piePlot.setLabelPaint(WidgetUtils.BG_COLOR_DARK);
      piePlot.setSectionOutlinesVisible(false);
      piePlot.setLabelLinkStyle(PieLabelLinkStyle.QUAD_CURVE);
    } else if (plot instanceof CategoryPlot) {
      // tweaks for bar charts
      final CategoryPlot categoryPlot = (CategoryPlot) plot;
     
      int columnCount = categoryPlot.getDataset().getColumnCount();
      if (columnCount > 1) {
        categoryPlot.setDomainGridlinesVisible(true);
      } else {
        categoryPlot.setDomainGridlinesVisible(false);
      }
      categoryPlot.setDomainGridlinePaint(WidgetUtils.BG_COLOR_DARK);
      categoryPlot.setDomainGridlinePosition(CategoryAnchor.END);

      categoryPlot.getDomainAxis().setLabelFont(WidgetUtils.FONT_SMALL);
      categoryPlot.getDomainAxis().setTickLabelFont(WidgetUtils.FONT_SMALL);
      categoryPlot.getRangeAxis().setLabelFont(WidgetUtils.FONT_SMALL);
      categoryPlot.getRangeAxis().setTickLabelFont(WidgetUtils.FONT_SMALL);
      categoryPlot.setDrawingSupplier(new DCDrawingSupplier());

      final CategoryItemRenderer renderer = categoryPlot.getRenderer();
      renderer.setBaseOutlinePaint(WidgetUtils.BG_COLOR_DARK);
      renderer.setBaseOutlineStroke(wideStroke);

      if (renderer instanceof BarRenderer) {
        BarRenderer barRenderer = (BarRenderer) renderer;
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.