Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.ValueAxis


      categoryPlot.setRangeZeroBaselineVisible(visibility.isRangeZeroBaseline());
      categoryPlot.setRangeCrosshairVisible(visibility.isRangeCrosshair());
      /**
       * RANGE Axis settings
       */
      ValueAxis     rangeAxis      = categoryPlot.getRangeAxis();
     
      rangeAxis.setAxisLineVisible(visibility.isAxisLine());
      rangeAxis.setTickMarksVisible(visibility.isTickMarks());
      rangeAxis.setMinorTickMarksVisible(visibility.isMinerTickMarks());
     
      Color axisLabel = new Color(colors.getAxisLabel());
      Color tickLabel = new Color(colors.getTickLabel());
     
      rangeAxis.setLabelPaint(axisLabel);
      rangeAxis.setTickLabelPaint(tickLabel);
      if(rangeAxis instanceof NumberAxis){
        NumberAxis numberAxis = (NumberAxis)rangeAxis;
        // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      }
     
View Full Code Here


    {
      categoryAxis.setCategoryMargin(categoryMargin.doubleValue());
    }


    final ValueAxis rangeAxis = cpl.getRangeAxis();
    if (rangeAxis instanceof NumberAxis)
    {
      final NumberAxis numberAxis = (NumberAxis) rangeAxis;

      if (getRangePeriodCount() > 0)
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setTickUnit(new NumberTickUnit(getRangePeriodCount(), getRangeTickFormat()));
        }
        else if (getRangeTickFormatString() != null)
        {
          final FastDecimalFormat formatter = new FastDecimalFormat
              (getRangeTickFormatString(), getResourceBundleFactory().getLocale());
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount()));
        }
      }
      else
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setNumberFormatOverride(getRangeTickFormat());
        }
        else if (getRangeTickFormatString() != null)
        {
          final DecimalFormat formatter = new DecimalFormat
              (getRangeTickFormatString(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setNumberFormatOverride(formatter);
        }
      }
    }
    else if (rangeAxis instanceof DateAxis)
    {
      final DateAxis numberAxis = (DateAxis) rangeAxis;

      if (getRangePeriodCount() > 0 && getRangeTimePeriod() != null)
      {
        if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount()));
        }
      }
      else if (getRangeTickFormatString() != null)
      {
        final SimpleDateFormat formatter = new SimpleDateFormat
            (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
        numberAxis.setDateFormatOverride(formatter);
      }

    }

    if (rangeAxis != null)
    {
      rangeAxis.setLabelFont(labelFont);
      rangeAxis.setTickLabelFont(labelFont);

      if (getRangeTitleFont() != null)
      {
        rangeAxis.setLabelFont(getRangeTitleFont());
      }
      if (getRangeTickFont() != null)
      {
        rangeAxis.setTickLabelFont(getRangeTickFont());
      }
      if (getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND)
      {
        rangeAxis.setLowerBound(getRangeMinimum());
      }
      if (getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND)
      {
        rangeAxis.setUpperBound(getRangeMaximum());
      }
    }

  }
View Full Code Here

      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final CategoryAxis categoryAxis = new FormattedCategoryAxis(categoryAxisLabel,
        getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale());
    categoryAxis.setCategoryMargin(0.0);
    final ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

    final StackedAreaRenderer renderer = new StackedAreaRenderer();
    if (tooltips)
    {
      renderer.setBaseToolTipGenerator(
View Full Code Here

    //add lines dataset and axis to plot
    if (linesDataset != null)
    {

      //Create Axis Objects
      final ValueAxis linesAxis;
      if (isSharedRangeAxis())
      {
        linesAxis = plot.getRangeAxis();
      }
      else if (isThreeD())
View Full Code Here

    final CategoryPlot plot = chart.getCategoryPlot();

    if (isSharedRangeAxis() == false)
    {
      final ValueAxis linesAxis = plot.getRangeAxis(1);
      if (linesAxis instanceof NumberAxis)
      {
        final NumberAxis numberAxis = (NumberAxis) linesAxis;

        if (getLinePeriodCount() > 0)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final FastDecimalFormat formatter = new FastDecimalFormat
                (getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
          }
          else
          {
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount()));
          }
        }
        else
        {
          if (getLineTicksLabelFormat() != null)
          {
            final DecimalFormat formatter = new DecimalFormat
                (getLineTicksLabelFormat(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setNumberFormatOverride(formatter);
          }
        }
      }
      else if (linesAxis instanceof DateAxis)
      {
        final DateAxis numberAxis = (DateAxis) linesAxis;

        if (getLinePeriodCount() > 0 && getLineTimePeriod() != null)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final SimpleDateFormat formatter = new SimpleDateFormat
                (getLineTicksLabelFormat(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount(), formatter));
          }
          else
          {
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount()));
          }
        }
        else if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setDateFormatOverride(formatter);
        }
      }

      if (linesAxis != null)
      {
        final Font labelFont = Font.decode(getLabelFont());
        linesAxis.setLabelFont(labelFont);
        linesAxis.setTickLabelFont(labelFont);

        if (getLineTitleFont() != null)
        {
          linesAxis.setLabelFont(getLineTitleFont());
        }
        if (getLineTickFont() != null)
        {
          linesAxis.setTickLabelFont(getLineTickFont());
        }
        if (getLineRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND)
        {
          linesAxis.setLowerBound(getLineRangeMinimum());
        }
        if (getLineRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND)
        {
          linesAxis.setUpperBound(getLineRangeMaximum());
        }
      }
    }

    final LineAndShapeRenderer linesRenderer = (LineAndShapeRenderer) plot.getRenderer(1);
View Full Code Here

                                                    final boolean legend,
                                                    final boolean tooltips,
                                                    final boolean urls,
                                                    final boolean stacked)
  {
    final ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    timeAxis.setLowerMargin(0.02)// reduce the default margins
    timeAxis.setUpperMargin(0.02);
    final NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    valueAxis.setAutoRangeIncludesZero(false)// override default
    final XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null);

    XYToolTipGenerator toolTipGenerator = null;
View Full Code Here

    if (orientation == null)
    {
      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    ValueAxis domainAxis = null;
    if (dateAxis)
    {
      domainAxis = new DateAxis(xAxisLabel);
    }
    else
    {
      final NumberAxis axis = new NumberAxis(xAxisLabel);
      axis.setAutoRangeIncludesZero(false);
      domainAxis = axis;
    }
    final ValueAxis valueAxis = new NumberAxis(yAxisLabel);

    final XYBarRenderer renderer = new XYBarRenderer();
    renderer.setUseYInterval(true);
    if (tooltips)
    {
View Full Code Here

    if (orientation == null)
    {
      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    ValueAxis domainAxis = null;
    if (dateAxis)
    {
      domainAxis = new DateAxis(xAxisLabel);
    }
    else
    {
      final NumberAxis axis = new NumberAxis(xAxisLabel);
      axis.setAutoRangeIncludesZero(false);
      domainAxis = axis;
    }
    final ValueAxis valueAxis = new NumberAxis(yAxisLabel);

    final StackedXYBarRenderer renderer = new StackedXYBarRenderer();
    renderer.setUseYInterval(true);
    if (tooltips)
    {
View Full Code Here

                                                 final boolean legend,
                                                 final boolean tooltips,
                                                 final boolean urls,
                                                 final boolean stacked)
  {
    final ValueAxis timeAxis = new DateAxis(timeAxisLabel);
    timeAxis.setLowerMargin(0.02)// reduce the default margins
    timeAxis.setUpperMargin(0.02);
    final NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    valueAxis.setAutoRangeIncludesZero(false)// override default
    final XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null);

    XYToolTipGenerator toolTipGenerator = null;
View Full Code Here

    {
      return;
    }

    //Create Axis Objects
    final ValueAxis linesAxis;
    if (isSharedRangeAxis())
    {
      linesAxis = plot.getRangeAxis();
    }
    else if (isThreeD())
View Full Code Here

TOP

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

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.