public void setAutoTickUnit(NumberAxis numberAxis) { if (numberAxis.isAutoTickUnitSelection()) { Range range = numberAxis.getRange(); if (range.getLength() >= AUTO_TICK_UNIT_THRESHOLD) { // this is a workaround for a floating point error makes JFreeChart // select tick units that are too small when the values are very large double autoSize = range.getLength() / AUTO_TICK_UNIT_THRESHOLD; TickUnit unit = numberAxis.getStandardTickUnits().getCeilingTickUnit(autoSize); numberAxis.setTickUnit((NumberTickUnit) unit, false, false); } } }
@Override public TickUnit getCeilingTickUnit(double size) { TickUnit newUnit = decorated.getCeilingTickUnit(size); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } }
@Override public TickUnit getCeilingTickUnit(TickUnit unit) { TickUnit newUnit = decorated.getCeilingTickUnit(unit); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } }
@Override public TickUnit getLargerTickUnit(TickUnit unit) { TickUnit newUnit = decorated.getLargerTickUnit(unit); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } }
public TickUnit getCeilingTickUnit(TickUnit unit) { return new TicketUnitImpl(labelFormat,unit); }
public TickUnit getCeilingTickUnit(double size) { return new TicketUnitImpl(labelFormat,size); }
public TickUnit getLargerTickUnit(TickUnit unit) { return new TicketUnitImpl(labelFormat,unit); }
@Override public TickUnit getCeilingTickUnit(TickUnit unit) { return new TickUnitWrap(tus.getCeilingTickUnit(unit),labelFormat); }
@Override public TickUnit getCeilingTickUnit(double size) { return new TickUnitWrap(tus.getCeilingTickUnit(size),labelFormat); }
@Override public TickUnit getLargerTickUnit(TickUnit unit) { return new TickUnitWrap(tus.getLargerTickUnit(unit),labelFormat); }
public TickUnitWrap(TickUnit tickUnit, int labelFormat) { super(tickUnit.getSize()); this.tickUnit=tickUnit; this.labelFormat=labelFormat; }
/** * Sets the tick unit that controls the spacing of the angular grid * lines, and sends a {@link PlotChangeEvent} to all registered listeners. * * @param unit the tick unit (<code>null</code> not permitted). * * @since 1.0.10 */ public void setAngleTickUnit(TickUnit unit) { if (unit == null) { throw new IllegalArgumentException("Null 'unit' argument."); } this.angleTickUnit = unit; fireChangeEvent(); }
/** * Returns the tick unit that controls the spacing of the angular grid * lines. * * @return The tick unit (never <code>null</code>). * * @since 1.0.10 */ public TickUnit getAngleTickUnit() { return this.angleTickUnit; }
/** * Sets the tick unit that controls the spacing of the angular grid * lines, and sends a {@link PlotChangeEvent} to all registered listeners. * * @param unit the tick unit (<code>null</code> not permitted). * * @since 1.0.10 */ public void setAngleTickUnit(TickUnit unit) { ParamChecks.nullNotPermitted(unit, "unit"); this.angleTickUnit = unit; fireChangeEvent(); }
/** * Returns the tick unit that controls the spacing of the angular grid * lines. * * @return The tick unit (never {@code null}). * * @since 1.0.10 */ public TickUnit getAngleTickUnit() { return this.angleTickUnit; }
/** * Sets the tick unit that controls the spacing of the angular grid * lines, and sends a {@link PlotChangeEvent} to all registered listeners. * * @param unit the tick unit ({@code null} not permitted). * * @since 1.0.10 */ public void setAngleTickUnit(TickUnit unit) { Args.nullNotPermitted(unit, "unit"); this.angleTickUnit = unit; fireChangeEvent(); }
/** * Constructor of the class * @param unit */ public TicketUnitImpl(int labelFormat,TickUnit unit) { this(labelFormat,unit.getSize()); }