/** * Configures the axis to work with the specified plot. If the axis has * auto-scaling, then sets the maximum and minimum values. */ @Override public void configure() { if (isAutoRange()) { autoAdjustRange(); } }
/** * Configures the axis to work with the specified plot. If the axis has * auto-scaling, then sets the maximum and minimum values. */ public void configure() { if (isAutoRange()) { autoAdjustRange(); } }
this.autoRange = axis.isAutoRange(); this.minimumValue = axis.getLowerBound(); this.maximumValue = axis.getUpperBound();
/** * Sets a flag that affects the auto-range when zero falls outside the data * range but inside the margins defined for the axis. * * @param flag the new flag. * * @see #getAutoRangeStickyZero() */ public void setAutoRangeStickyZero(boolean flag) { if (this.autoRangeStickyZero != flag) { this.autoRangeStickyZero = flag; if (isAutoRange()) { autoAdjustRange(); } notifyListeners(new AxisChangeEvent(this)); } }
/** * Sets a flag that affects the auto-range when zero falls outside the data * range but inside the margins defined for the axis. * * @param flag the new flag. * * @see #getAutoRangeStickyZero() */ public void setAutoRangeStickyZero(boolean flag) { if (this.autoRangeStickyZero != flag) { this.autoRangeStickyZero = flag; if (isAutoRange()) { autoAdjustRange(); } notifyListeners(new AxisChangeEvent(this)); } }
/** * Sets the flag that indicates whether or not the axis range, if * automatically calculated, is forced to include zero. * <p> * If the flag is changed to <code>true</code>, the axis range is * recalculated. * <p> * Any change to the flag will trigger an {@link AxisChangeEvent}. * * @param flag the new value of the flag. * * @see #getAutoRangeIncludesZero() */ public void setAutoRangeIncludesZero(boolean flag) { if (this.autoRangeIncludesZero != flag) { this.autoRangeIncludesZero = flag; if (isAutoRange()) { autoAdjustRange(); } notifyListeners(new AxisChangeEvent(this)); } }
/** * Sets the flag that indicates whether or not the axis range, if * automatically calculated, is forced to include zero. * <p> * If the flag is changed to {@code true}, the axis range is * recalculated. * <p> * Any change to the flag will trigger an {@link AxisChangeEvent}. * * @param flag the new value of the flag. * * @see #getAutoRangeIncludesZero() */ public void setAutoRangeIncludesZero(boolean flag) { if (this.autoRangeIncludesZero != flag) { this.autoRangeIncludesZero = flag; if (isAutoRange()) { autoAdjustRange(); } notifyListeners(new AxisChangeEvent(this)); } }
public static void customizeNumberAxis(NumberAxis axis, ChartParams params, String prefix) { customizeValueAxis(axis, params, prefix); if (axis.isAutoRange()) { // work only with auto range if (params.get(prefix + ChartParams.NUMBER_AXIS_AUTO_RANGE_INCLUDES_ZERO_SUFFIX) != null) { axis.setAutoRangeIncludesZero(params.getBoolean( prefix + ChartParams.NUMBER_AXIS_AUTO_RANGE_INCLUDES_ZERO_SUFFIX).booleanValue()); } if (params.get(prefix + ChartParams.NUMBER_AXIS_AUTO_RANGE_STICKY_ZERO_SUFFIX) != null) { axis.setAutoRangeStickyZero(params.getBoolean( prefix + ChartParams.NUMBER_AXIS_AUTO_RANGE_STICKY_ZERO_SUFFIX).booleanValue()); } } if (params.get(prefix + ChartParams.NUMBER_AXIS_RANGE_TYPE_SUFFIX) != null) { axis.setRangeType(params.getRangeType(prefix + ChartParams.NUMBER_AXIS_RANGE_TYPE_SUFFIX)); } if (params.get(prefix + ChartParams.NUMBER_AXIS_NUMBER_TICK_UNIT_SUFFIX) != null) { if (axis.isAutoTickUnitSelection()) { axis.setAutoTickUnitSelection(false); } axis.setTickUnit(params.getNumberTickUnit(prefix + ChartParams.NUMBER_AXIS_NUMBER_TICK_UNIT_SUFFIX)); } if (params.get(prefix + ChartParams.NUMBER_AXIS_NUMBER_FORMAT_OVERRIDE_SUFFIX) != null) { axis.setNumberFormatOverride(params.getNumberFormat(prefix + ChartParams.NUMBER_AXIS_NUMBER_FORMAT_OVERRIDE_SUFFIX)); } }