Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.CategoryAxis


        PlotOrientation.VERTICAL, true, // include legend
        true, // tooltips?
        false // URL generator? Not required...
        );
    CategoryPlot plot = chart.getCategoryPlot();
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
    ChartPanel cp = new ChartPanel(chart);
    cp.setBackground(UIManager.getColor("Button.shadow"));
    cp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    return cp;
View Full Code Here


          XYItemRenderer rend = (XYItemRenderer) PlotTypes.getRenderer(rendererIndex);
          plot.setRenderer(plotidx, rend);
        }
        return new JFreeChart(title, new Font("SansSerif", Font.BOLD, 18), plot, showLegend);
      case OVERLAY_CATEGORY ://added by lrh 2005-07-11
        CategoryAxis domainAxis2 = (CategoryAxis)axisFactory.createAxis(ORIENTATION_HORIZONTAL, xAxisType, xAxisLabel);
        // get main plot
        mainPlotDef = (PlotDefinition) plotDefinitions.get(0);
        check(mainPlotDef.getDataset(), CategoryDataset.class, chartType);
        CategoryPlot plot2 = (CategoryPlot) mainPlotDef.getPlot(chartTypeConst);
        plot2.setDomainAxis(domainAxis2);
View Full Code Here

      case AXIS_TYPE_DATE :
        return new DateAxis(label);
      case AXIS_TYPE_NUMBER :
        return new NumberAxis(label);
      case AXIS_TYPE_CATEGORY://added by lrh 2005-07-11
              return new CategoryAxis(label);
      default:
        throw new RuntimeException("unsupported axis type constant " + type);
    }
  }
View Full Code Here

        );
        renderer.setSeriesPaint(0, gp0);
        renderer.setSeriesPaint(1, gp1);
        renderer.setSeriesPaint(2, gp2);

        CategoryAxis domainAxis = plot.getDomainAxis();
        domainAxis.setCategoryLabelPositions(
                CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
        );
        // OPTIONAL CUSTOMISATION COMPLETED.

        return writeImageMap(chart, outputElement, session, printWriter);
View Full Code Here

    @Override
    public JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, final Dataset dataset,
            PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
    {
        CategoryAxis xAxis = new CategoryAxis(xAxisTitle);
        ValueAxis yAxis = new NumberAxis(yAxisTitle);
        CategoryItemRenderer renderer = new StatisticalBarRenderer();

        CategoryPlot plot = new CategoryPlot((StatisticalCategoryDataset) dataset, xAxis, yAxis, renderer);
View Full Code Here

      }

      if (graphType != GRAPH_TYPE_PIE) {
        // skip some labels if they overlap...
        CategoryPlot catplot = (CategoryPlot) chart.getPlot();
        CategoryAxis domainAxis = (CategoryAxis) catplot.getDomainAxis();
//        domainAxis.setSkipCategoryLabelsToFit(true);

        // set the range axis to display integers only...
        NumberAxis rangeAxis = (NumberAxis) catplot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
View Full Code Here

                0.0f, 0.0f, new Color(64, 0, 0));
        renderer.setSeriesPaint(0, gp0);
        renderer.setSeriesPaint(1, gp1);
        renderer.setSeriesPaint(2, gp2);

        CategoryAxis domainAxis = plot.getDomainAxis();
        domainAxis.setCategoryLabelPositions(
                CategoryLabelPositions.createUpRotationLabelPositions(
                        Math.PI / 6.0));
        // OPTIONAL CUSTOMISATION COMPLETED.

        return chart;
View Full Code Here

                new StandardCategoryToolTipGenerator());
        CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2,
                renderer2);
        subplot2.setDomainGridlinesVisible(true);

        CategoryAxis domainAxis = new CategoryAxis("Category");
        CombinedCategoryPlot plot = new CombinedCategoryPlot(
                domainAxis, new NumberAxis("Range"));
        plot.add(subplot1, 2);
        plot.add(subplot2, 1);
View Full Code Here

        plot.setShadowGenerator(this.shadowGenerator);

        // process all domain axes
        int domainAxisCount = plot.getDomainAxisCount();
        for (int i = 0; i < domainAxisCount; i++) {
            CategoryAxis axis = plot.getDomainAxis(i);
            if (axis != null) {
                applyToCategoryAxis(axis);
            }
        }
View Full Code Here

                0.0f, 0.0f, new Color(64, 0, 0));
        renderer.setSeriesPaint(0, gp0);
        renderer.setSeriesPaint(1, gp1);
        renderer.setSeriesPaint(2, gp2);

        CategoryAxis domainAxis = plot.getDomainAxis();
        domainAxis.setCategoryLabelPositions(
                CategoryLabelPositions.createUpRotationLabelPositions(
                        Math.PI / 6.0));
        // OPTIONAL CUSTOMISATION COMPLETED.

        return chart;
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.CategoryAxis

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.