@Test public void scaleValue1() { ValueScale linearScale = ValueScales.linearScale(); assertThat(linearScale.scaleValue(3.5, 3, 4, 0, 100), equalTo(50.0)); }
@Override public double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue) { double oldRange = maxValue - minValue; double newRange = newMaxValue - newMinValue; return newMinValue + (value - minValue) / oldRange * newRange; }
LinearValueScale implements ValueScale { @Override public double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue) { double oldRange = maxValue - minValue; double newRange = newMaxValue - newMinValue; return newMinValue + (value - minValue) / oldRange * newRange; } }
LinearValueScale implements ValueScale { @Override public double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue) { double oldRange = maxValue - minValue; double newRange = newMaxValue - newMinValue; return newMinValue + (value - minValue) / oldRange * newRange; }  }
LinearValueScale implements ValueScale { @Override public double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue) { double oldRange = maxValue - minValue; double newRange = newMaxValue - newMinValue; return newMinValue + (value - minValue) / oldRange * newRange; }  @Override double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue); @Override double invScaleValue(double scaleValue, double minValue, double maxValue, double newMinValue, double newMaxValue); @Override ValueAxis references(Range range, int minRefs, int maxRefs); }
LinearValueScale implements ValueScale { @Override public double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue) { double oldRange = maxValue - minValue; double newRange = newMaxValue - newMinValue; return newMinValue + (value - minValue) / oldRange * newRange; }  @Override double scaleValue(double value, double minValue, double maxValue, double newMinValue, double newMaxValue); @Override double invScaleValue(double scaleValue, double minValue, double maxValue, double newMinValue, double newMaxValue); @Override ValueAxis references(Range range, int minRefs, int maxRefs);  }