Examples of CategoryAxis


Examples of org.jfree.chart.axis.CategoryAxis

  protected void handleCategoryPlotSettings(CategoryPlot p, JRChartPlot jrPlot)
  {
    Double defaultPlotLabelRotation = (Double)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_LABEL_ROTATION);
    PlotOrientation defaultPlotOrientation = (PlotOrientation)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_ORIENTATION);
    // Handle rotation of the category labels.
    CategoryAxis axis = p.getDomainAxis();
    boolean hasRotation = jrPlot.getLabelRotationDouble() != null || defaultPlotLabelRotation != null;
    if(hasRotation)
    {
      double labelRotation = jrPlot.getLabelRotationDouble() != null ?
          jrPlot.getLabelRotationDouble().doubleValue() :
          defaultPlotLabelRotation.doubleValue();
     
      if (labelRotation == 90)
      {
        axis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);
      }
      else if (labelRotation == -90) {
        axis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
      }
      else if (labelRotation < 0)
      {
        axis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions( (-labelRotation / 180.0) * Math.PI));
      }
      else if (labelRotation > 0)
      {
        axis.setCategoryLabelPositions(
            CategoryLabelPositions.createDownRotationLabelPositions((labelRotation / 180.0) * Math.PI));
      }
    }
   
    if(defaultPlotOrientation != null)
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

  protected void handleCategoryPlotSettings(CategoryPlot p, JRChartPlot jrPlot)
  {
    PlotSettings plotSettings = getPlotSettings();
    Double themeLabelRotation = plotSettings.getLabelRotation();
    // Handle rotation of the category labels.
    CategoryAxis axis = p.getDomainAxis();
    boolean hasRotation = jrPlot.getLabelRotationDouble() != null || themeLabelRotation != null;
    if(hasRotation)
    {
      double labelRotation = jrPlot.getLabelRotationDouble() != null 
          ? jrPlot.getLabelRotationDouble().doubleValue()
          : themeLabelRotation.doubleValue();
     
      if (labelRotation == 90)
      {
        axis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);
      }
      else if (labelRotation == -90) {
        axis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
      }
      else if (labelRotation < 0)
      {
        axis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions( (-labelRotation / 180.0) * Math.PI));
      }
      else if (labelRotation > 0)
      {
        axis.setCategoryLabelPositions(
            CategoryLabelPositions.createDownRotationLabelPositions((labelRotation / 180.0) * Math.PI));
      }
    }
   
    PlotOrientation plotOrientation = jrPlot.getOrientation() != null ? jrPlot.getOrientation() : plotSettings.getOrientation();
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

    }
   
    public static void createBoxplot(DefaultBoxAndWhiskerCategoryDataset scatterDataset, PrintStream outStream,
            String title, String xAxisLabel, String yAxisLabel, Font lableFont ) throws IOException{
      
        CategoryAxis xAxis = new CategoryAxis(xAxisLabel);
        xAxis.setLabelFont(lableFont);
        NumberAxis yAxis = new NumberAxis(yAxisLabel);
        yAxis.setTickLabelFont(lableFont);
        yAxis.setAutoRangeIncludesZero(false);
        yAxis.setRange(0, 100);
        yAxis.setLabelFont(lableFont);
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

                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

Examples of org.jfree.chart.axis.CategoryAxis

            renderer.setBaseStroke(new BasicStroke(3));

            for (int i = 0; i < series.size(); i++)
                renderer.setSeriesPaint(i, series.get(i).color);

            final CategoryAxis domainAxis = new NoOverlapCategoryAxis(null);
            plot.setDomainAxis(domainAxis);
            domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
            domainAxis.setLowerMargin(0.0);
            domainAxis.setUpperMargin(0.0);
            domainAxis.setCategoryMargin(0.0);

            final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
            rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

            // crop extra space around the graph
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

                // plot.setDomainGridlinesVisible(true);
                // plot.setDomainGridlinePaint(Color.white);
                plot.setRangeGridlinesVisible(true);
                plot.setRangeGridlinePaint(Color.black);

                CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
                plot.setDomainAxis(domainAxis);
                domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
                domainAxis.setLowerMargin(0.0);
                domainAxis.setUpperMargin(0.0);
                domainAxis.setCategoryMargin(0.0);

                final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
                ChartUtil.adjustChebyshev(dataset, rangeAxis);
                rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

//        plot.setDomainGridlinesVisible(true);
//        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinesVisible(true);
        plot.setRangeGridlinePaint(Color.black);

        CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
        plot.setDomainAxis(domainAxis);
        domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
        domainAxis.setLowerMargin(0.0);
        domainAxis.setUpperMargin(0.0);
        domainAxis.setCategoryMargin(0.0);

        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        StackedAreaRenderer ar = new StackedAreaRenderer2() {
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

        final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
        renderer.setBaseStroke(new BasicStroke(3));
        configureRenderer(renderer);

        final CategoryAxis domainAxis = new NoOverlapCategoryAxis(null);
        plot.setDomainAxis(domainAxis);
        domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
        domainAxis.setLowerMargin(0.0);
        domainAxis.setUpperMargin(0.0);
        domainAxis.setCategoryMargin(0.0);

        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        // crop extra space around the graph
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

    @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

Examples of org.jfree.chart.axis.CategoryAxis

            // plot.setDomainGridlinesVisible(true);
            // plot.setDomainGridlinePaint(Color.white);
            plot.setRangeGridlinesVisible(true);
            plot.setRangeGridlinePaint(Color.black);

            CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
            plot.setDomainAxis(domainAxis);
            domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
            domainAxis.setLowerMargin(0.0);
            domainAxis.setUpperMargin(0.0);
            domainAxis.setCategoryMargin(0.0);

            final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
            ChartUtil.adjustChebyshev(dataset, rangeAxis);
            rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
            rangeAxis.setAutoRange(true);
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.