Examples of NumberAxis


Examples of org.jfree.chart.axis.NumberAxis

                                                    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;
    if (tooltips)
    {
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    {
      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

Examples of org.jfree.chart.axis.NumberAxis

    {
      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

Examples of org.jfree.chart.axis.NumberAxis

    {
      linesAxis = new NumberAxis3D(getSecondValueAxisLabel());
    }
    else
    {
      linesAxis = new NumberAxis(getSecondValueAxisLabel());
    }

    final XYItemRenderer lineRenderer;
    if (isThreeD())
    {
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    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)
      {
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

                                                 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;
    if (tooltips)
    {
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    if (orientation == null)
    {
      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    xAxis.setLowerMargin(0.0);
    xAxis.setUpperMargin(0.0);
    final NumberAxis yAxis = new NumberAxis(yAxisLabel);
    XYToolTipGenerator toolTipGenerator = null;
    if (tooltips)
    {
      toolTipGenerator = new StandardXYToolTipGenerator();
    }
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    // May be an axis that supports dates
    final ValueAxis domainAxis = plot.getDomainAxis();
    if (domainAxis instanceof NumberAxis)
    {
      final NumberAxis numberAxis = (NumberAxis) domainAxis;
      numberAxis.setAutoRangeIncludesZero(isDomainIncludesZero());
      numberAxis.setAutoRangeStickyZero(isDomainStickyZero());
      if (getDomainPeriodCount() > 0)
      {
        if (getDomainTickFormat() != null)
        {
          numberAxis.setTickUnit(new NumberTickUnit(getDomainPeriodCount(), getDomainTickFormat()));
        }
        else if (getDomainTickFormatString() != null)
        {
          final FastDecimalFormat formatter = new FastDecimalFormat
              (getDomainTickFormatString(), getResourceBundleFactory().getLocale());
          numberAxis.setTickUnit(new FastNumberTickUnit(getDomainPeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit(new FastNumberTickUnit(getDomainPeriodCount()));
        }
      }
      else
      {
        if (getDomainTickFormat() != null)
        {
          numberAxis.setNumberFormatOverride(getDomainTickFormat());
        }
        else if (getDomainTickFormatString() != null)
        {
          final DecimalFormat formatter = new DecimalFormat
              (getDomainTickFormatString(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setNumberFormatOverride(formatter);
        }
      }
    }
    else if (domainAxis instanceof DateAxis)
    {
      final DateAxis numberAxis = (DateAxis) domainAxis;

      if (getDomainPeriodCount() > 0 && getDomainTimePeriod() != null)
      {
        if (getDomainTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getDomainTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getDomainTimePeriod()), (int) getDomainPeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getDomainTimePeriod()), (int) getDomainPeriodCount()));
        }
      }
    }

    if (domainAxis != null)
    {
      domainAxis.setLabel(getDomainTitle());
      if (getDomainTitleFont() != null)
      {
        domainAxis.setLabelFont(getDomainTitleFont());
      }
      domainAxis.setVerticalTickLabels(isDomainVerticalTickLabels());
      if (getDomainTickFont() != null)
      {
        domainAxis.setTickLabelFont(getDomainTickFont());
      }
      if (getDomainMinimum() != ValueAxis.DEFAULT_LOWER_BOUND)
      {
        domainAxis.setLowerBound(getDomainMinimum());
      }
      if (getDomainMaximum() != ValueAxis.DEFAULT_UPPER_BOUND)
      {
        domainAxis.setUpperBound(getDomainMaximum());
      }
    }

    final ValueAxis rangeAxis = plot.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)
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    protected void updateChartProperties() {
      ValueAxis xaxis = null;
      if (cbcyclex.isSelected()) {
        xaxis = new CyclicNumberAxis(nfperiodx.getDoubleValue(),nfoffsetx.getDoubleValue());
      } else {
        xaxis = new NumberAxis();
        if (nffixedautox.isEnabled()) xaxis.setFixedAutoRange(nffixedautox.getDoubleValue());
      }
      xaxis.setAutoRange(cbautox.isSelected());
      xaxis.setInverted(cbinvertx.isSelected());
      if (tfpxmin.isEnabled() && tfpxmax.isEnabled()) xaxis.setRange(tfpxmin.getDoubleValue(), tfpxmax.getDoubleValue());
     
      ValueAxis yaxis = null;
      if (cbcycley.isSelected()) {
        yaxis = new CyclicNumberAxis(nfperiody.getDoubleValue(),nfoffsety.getDoubleValue());
      } else {
        yaxis = new NumberAxis();
        if (nffixedautoy.isEnabled()) yaxis.setFixedAutoRange(nffixedautoy.getDoubleValue());
      }
      yaxis.setAutoRange(cbautoy.isSelected());
      yaxis.setInverted(cbinverty.isSelected());
      if (tfpymin.isEnabled() && tfpymax.isEnabled()) yaxis.setRange(tfpymin.getDoubleValue(), tfpymax.getDoubleValue());
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

  }

  public StandardPlotShape(JFreeChart chart, int ox, int oy, int width, int height) {
    super(chart, ox, oy, width, height);
    XYPlot plot = chart.getXYPlot();
    NumberAxis axis = new NumberAxis();
    //CyclicNumberAxis axis = new CyclicNumberAxis(0, 100);
    plot.setDomainAxis(axis);
    axis.setAutoRange(true);
    //axis.setAutoRangeIncludesZero(false);
    ValueAxis vaxis = plot.getRangeAxis();
    axis.setAutoRange(true);
    if (vaxis instanceof NumberAxis) {((NumberAxis)vaxis).setAutoRangeIncludesZero(false);}
    plot.setRenderer(new JSynopticStandardXYItemRenderer());
    //plot.setRenderer(new CyclicXYItemRenderer());
    plot.setRangeCrosshairLockedOnData(false);
    plot.setDomainCrosshairLockedOnData(false);
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.