RCHART TUTORIAL, Chapter 4

Copyright 2003, J4L Components (http://www.java4less.com)
Go bak to contents


Scale configuration / parameters

 

Maximum and minimum values

The following section describes how the maximum and minimum values of the scale are calculated. The examples refer to the Y-Axis, however the same parameters are also available for the X and Y2 axis.

If you want to plot the following values:

10, 41 , 48 , 39, 36 ,34 , 49

you can use the following way in order to calculate the maximum and minimum values of the axis:

Parameters
Description
Equivalent Java[TM] class/property

YSCALE_MIN=0
YSCALE_MAX=50

Minimum value of the scale
Maxumim value of the scale

xaxis.scale.min
yaxis.scale.max

the result will be:

 

Parameters
Description
Equivalent Java[TM] class/property

YSCALE_EXACT_MAX=true
YSCALE_EXACT_MIN=true
YSCALE_PREF_MAXMIN=-1000000|-500000|-100000|-50000|-10000|-5000|-1000|-500|-250|-100|-50|-25-10|-5|-1|-0.5|-|0.1|0|0.1|0.5|1|5|10|25|50|100|250|500|1000|5000|10000|50000|100000|500000|1000000

Take the min. and max. values from the list of preferred values.

yaxis.scale.exactMaxValue
yaxis.scale.exactMinValue
yaxis.scale.preferred_MaxMin_values

 

RChart will use one of the values from the list you provided. This list must be sorted in ascending order and RChart will always select the first value that meets the condition:

 

 

Parameters
Description
Equivalent Java[TM] class/property

YSCALE_MIN=0
YSCALE_EXACT_MIN=false
YSCALE_EXACT_MAX=true
YSCALE_PREF_MAXMIN=-1000000|-500000|-100000|-50000|-10000|-5000|-1000|-500|-250|-100|-50|-25-10|-5|-1|-0.5|-|0.1|0|0.1|0.5|1|5|10|25|50|100|250|500|1000|5000|10000|50000|100000|500000|1000000

Minimum is 0
Take max. value from the list of preferred values.

yaxis.scale.min
yaxis.scale.exactMaxValue
yaxis.scale.exactMinValue
yaxis.scale.preferred_MaxMin_values

 

Logarithmic Scales

the following additional parameters are needed for logarithmic scales:


Note: logarithmic scales do not accept negative values.

Example 1:

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 ...

Parameters
Description
Equivalent Java[TM] class/property

TICK_LOG_INTERVALY=true

YSCALE_LOG= true
YSCALE_LOG_BASE=10
YSCALE_MIN=0
YSCALE_MAX = 1000

Ticks show not be placed at fixed intervals bu using logaritmic scale.
Y Scale will use logarithmin scale
base 10
minimum and maximum values

YAxis.logarithmicIntervals=true;

YAxis.scale=logScale();
((logScale) YAxis.scale).base=10;
YAxis.scale.min=0;
YAxis.scale.min=1000;

Example 2:

The default base is 2. This means, the distance between 1 and 2 will be the same as the distance between 2 and 4, 4 and 8..

Parameters
Description
Equivalent Java[TM] class/property

TICK_LOG_INTERVALY=true
TSCALE_LOG=true
YSCALE_LOG_BASE=2

YSCALE_MIN=0
YSCALE_MAX = 1024

Ticks show not be placed at fixed intervals bu using logaritmic scale.
Y Scale will use logarithmin scale
base 2
minimum and maximum values

YAxis.logarithmicIntervals=true;

YAxis.scale=logScale();
((logScale) YAxis.scale).base=2;
YAxis.scale.min=0;
YAxis.scale.min=1024;