com.java4less.rchart
Class logScale
java.lang.Object
|
+--com.java4less.rchart.Scale
|
+--com.java4less.rchart.logScale
- public class logScale
- extends Scale
The scale converts the data to screen coordinates using logarithms.
Example:
// create axis
com.java4less.rchart.Axis YAxis=new Axis(Axis.VERTICAL,new logScale()
YAxis.scale.base=10;
YAxis.scale.min=1;
YAxis.scale.max=10000;
Note: logarithmic scales do not admit negative values.
Field Summary |
double |
base
Base of the logarithm for the scale.
|
Method Summary |
int |
getScreenCoord(double v)
convert a value to the screen coordinate. |
double |
getValue(int c)
converts a screen coordinate to the real value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
base
public double base
- Base of the logarithm for the scale.
- The default is 2. This means, the distance between 1 and 2 will be the same as the distance between 2 and 4, 4 and 8...
- A base of 10 means that the distance between 1 and 10 will be the same as the distance between 10 and 100, 100 and 1000 ...
logScale
public logScale()
logScale
public logScale(int ma,
int mi)
getScreenCoord
public int getScreenCoord(double v)
- Description copied from class:
Scale
- convert a value to the screen coordinate.
- Overrides:
getScreenCoord
in class Scale
getValue
public double getValue(int c)
- Description copied from class:
Scale
- converts a screen coordinate to the real value.
- Overrides:
getValue
in class Scale