All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----MSBChart.Scale
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.
public double max
maximum value of the scale.
public double min
minimum value of the scale.
public int screenMax
maximum value of scale on the screen.
public int screenMaxMargin
internal use. Calculated by Chart.
public int screenMin
minimum value of scale on the screen.
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.
public Scale()
public Scale(int ma, int mi)
creates a scale with the specifed max and min values.
public int getScreenCoord(double v)
convert a value to the screen coordinate.
public double getValue(int c)
converts a screen coordinate to the real value.
All Packages Class Hierarchy This Package Previous Next Index