All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MSBChart.Scale

java.lang.Object
   |
   +----MSBChart.Scale

public class Scale
extends Object

The scale converts the data to screen coordinates. All charts have two scales (except Pies), one per axis. 

Example:

// create axis
MSBChart.Axis XAxis=new Axis(Axis.HORIZONTAL,new Scale());
MSBChart.Axis YAxis=new Axis(Axis.VERTICAL,new Scale());
XAxis.scale.min=0;
XAxis.scale.max=7;
YAxis.scale.min=0;
YAxis.scale.max=7;

If the min and max properties are not specified, RChart will calculate them from the DataSeries.

 


Variable Index

 o max
 o min
 o reverse
 o screenMax
 o screenMaxMargin
 o screenMin

Constructor Index

 o Scale()
 o Scale(int, int)

Method Index

 o getScreenCoord(double)
 o getValue(int)

Variables

 o max
 public double max
maximum value of the scale.
 o min
 public double min
minimum value of the scale.
 
 o screenMax
 public int screenMax
maximum value of scale on the screen.
 
 o screenMaxMargin
 public int screenMaxMargin
internal use. Calculated by Chart.
 
 o screenMin
 public int screenMin
minimum value of scale on the screen.
 
 o reverse
 public boolean reverse

internal use. It is true if the scale corresponds to the vertical axis. In the vertical axis the screen coordinate of the min value is greater than the screen coordinate of the max value.

Constructors

 o Scale
 public Scale()
 o Scale
 public Scale(int ma,
              int mi)
creates a scale with the specifed max and min values.

Methods

 o getScreenCoord
 public int getScreenCoord(double v)
convert a value to the screen coordinate.
 o getValue
 public double getValue(int c)
converts a screen coordinate to the real value.

All Packages  Class Hierarchy  This Package  Previous  Next  Index