### RCHART, User Guide

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

### Gaugechart configuration

This is a complete example of a gaugechart with 2 subgauges:

Parameters | Description | Equivalent java class/property
YLABEL_COLOR=0xffffff Y2AXIS=TRUE YAXIS=TRUE XSCALE_MIN=0 YSCALE_MIN=0 Y2SCALE_MIN=0 XSCALE_MAX=100 YSCALE_MAX=25 Y2SCALE_MAX=15 XAXIS_START_WITH_BIG_TICK=TRUE YAXIS_START_WITH_BIG_TICK=TRUE Y2AXIS_START_WITH_BIG_TICK=TRUE YAXIS_STYLE=2.0|0xffffff|NORMAL YAXIS_FONT_COLOR=0xffffff XAXIS_INTEGER=TRUE YAXIS_INTEGER=TRUE LEGEND_FILL=0xffffff LEGEND_BORDER=0.2|0x0|NORMAL SERIE_1=gauge SERIE_2=gauge2 SERIE_3=gauge3 SERIE_TYPE_1=GAUGE SERIE_TYPE_2=GAUGE SERIE_TYPE_3=GAUGE SERIE_DATA_1=33|15|5 GAUGE_NEEDLE_1=Needle1 GAUGE_NEEDLE_2=Needle2 GAUGE_NEEDLE_3=needle3 GAUGE_NEEDLE_STYLE_1=0xff0000 GAUGE_NEEDLE_STYLE_2=0x0 GAUGE_NEEDLE_STYLE_3=0xffff00 SERIE_NEEDLE_STYLE_1=3.0|0x0|NORMAL SERIE_NEEDLE_STYLE_2=3.0|0x0|NORMAL SERIE_NEEDLE_STYLE_3=3.0|0x0|NORMAL SERIE_NEEDLE_LENTGH_1=70 GAUGE_RADIUS=0.8 GAUGE_BORDER=2.0|0x0|NORMAL GAUGE_AXIS1_LABEL_MARGIN=20 GAUGE_MAX_ZONE=90 GAUGE_MIN_ZONE=10 GAUGE_MAXMIN_ZONE_WIDTH=45 GAUGE_MAXMIN_ZONE_MARGIN=4 GAUGE_BACK=0xff GAUGE1_ENABLE=TRUE GAUGE1_BACK=0xffc800 GAUGE2_ENABLE=TRUE GAUGE2_BACK=0xffff LEGEND_MARGIN=0.3 | X scale is the one of the main gauge Y scale is the one of the orange gauge Y2 scale is the one of the cyan gauge All scales have a big tick at possition 0 Do not paint decimal point The gauge have 3 needles Values to plot Style of the needles Define possition, size and color of the read and green areas (max, min) Activate first subgauge Activate second subgauge | gaugePlotter.subGauge2.axis1=Y2Axis; gaugePlotter.subGauge1.axis1=YAxis; gaugePlotter=new GaugePlotter() serie=new GaugeDataSerie(values,styles); see values in constructor of new GaugeDataSerie; legend.addItem("Needle 1",fstyle); see styles in constructor of new GaugeDataSerie; serie.needleStyle serie.needleLength gaugePlotter.radiusModifier gaugePlotter.maxZone gaugePlotter.minZone gaugePlotter.maxminZoneWidth gaugePlotter.maxminZoneMargin gaugePlotter.subGauge1=new GaugePlotter(); gaugePlotter.subGauge2=new GaugePlotter();

The subgauges are enabled with:

- GAUGE1_ENABLE to true.
- GAUGE2_ENABLE to true.

In this case the last (or last two) value of the SERIE_DATA_1 parameter will be used in the subgauge1 (and/or subgauge2). In this example, the value 15 is used for subgauge1 and the value 5 for the subgauge 2.

Parameters of the gauge marked with (*) can be used to defined the subgauges by adding "1" or "2" to the "GAUGE" word in the parameter's name. For example: GAUGE1_BORDER,GAUGE1_BASE,GAUGE2_BORDER,GAUGE2_BASE and so on.

Parameters | Description | Equivalent java class/property
YAXIS=FALSE GAUGE1_ENABLE=FALSE GAUGE2_ENABLE=FALSE | remove second scale remove first subgauge remove second subgauge | gaugePlotter.axis2=null; gaugePlotter.subGauge1=null; gaugePlotter.subGauge2=null;

Gaugechart needs at least 1 scale, defined using the XAXIS* parameters. You can define a second scale for the gauge using the YAXIS* parameters. However, if you have defined subgauges, the YAXIS* scale will be used for subgauge1 and the Y2AXIS* scale parameters will be used for subgauge2.

Parameters | Description | Equivalent java class/property
YAXIS=TRUE YSCALE_MAX=25 YSCALE_MIN=0 | Creates second scale (the one in white) Define maximum value Define minimum value | gaugePlotter.axis2=YAxis; gaugePlotter.axis2.scale.max gaugePlotter.axis2.scale.min

The following parameters are used to configure the green and red areas:

- GAUGE_MAX_ZONE(*): Zone above this value will be coloured using MAX_ZONE_COLOR.
- GAUGE_MAX_ZONE_COLOR(*): Color used to mark the area near to the maximum in the scale. Default is red.
- GAUGE_MIN_ZONE(*): Zone under this value will be coloured using MIN_ZONE_COLOR.
- GAUGE_MIN_ZONE_COLOR(*): Color used to mark the area near to the minimum in the scale. Default is green.

Parameters | Description | Equivalent java class/property
GAUGE_MAX_ZONE=80 GAUGE_MAX_ZONE_COLOR=0xffc800 GAUGE_MIN_ZONE=20 GAUGE_MIN_ZONE_COLOR=0xffff | Orange area starts at pos. 80 Color of max. zone is Orange Cyan area ends at pos. 20 Color of min. zone is cyan | gaugePlotter.maxZone gaugePlotter.maxZoneColor gaugePlotter.minZone gaugePlotter.minZoneColor

You can also change the size of the circle at the base of the needle.

GAUGE_BASE (*): Size of the circle painted as needle base (% of the radius). Default is 6 which mean 6% of the size of the gauge

Parameters | Description | Equivalent java class/property
GAUGE_BASE=12 | Size of the red circle at the base | guagePlotter.needleBase

You can change the width of the areas that mark the max and min zones:

GAUGE_MAXMIN_ZONE_WIDTH(*): Width in pixels of the ring for the max and min zones. Default is 50.

Parameters | Description | Equivalent java class/property
GAUGE_MAXMIN_ZONE_WIDTH=15 | width in pixels of the orange and cyan areas (default is 50). | gaugePlotter.maxminZoneWidth=15;

You can change the margin of the areas that mark the max and min zones:

GAUGE_MAXMIN_ZONE_MARGIN(*):Margin, in pixels (distance to border) of the min/max area. Default is 5.

Parameters | Description | Equivalent java class/property
GAUGE_MAXMIN_ZONE_MARGIN=0 | Cero means, the area starts at the border. | gaugePlotter.maxminZoneMargin=50;

The following parameters are used to change the start and end possition (angles) of the gauge:

- GAUGE_START_ANGLE: Start angle of the scale of the gauge (default is -20). In order to draw a semicircular gauge you must use 0 as start angle and 180 as end angle.
- GAUGE_END_ANGLE(*): End angle of the scale of the gauge (default is 200).

Parameters | Description | Equivalent java class/property
GAUGE_START_ANGLE=10 GAUGE_END_ANGLE=170 | Scale starts at angle 10 and ends at angle 170 | gaugePlotter.startAngle=10; gaugePlotter.endAngle=170;

In order to change the possition of the labels of the scale you must use:

- GAUGE_AXIS1_LABEL_MARGIN(*). Labels margin (in pixels) of the main scale. Use positive/negative to place the labels outside/inside the circle.Default value is 10 (pixels outside the gauge).
- GAUGE_AXIS2_LABEL_MARGIN(*): Labels margin (in pixels) of the second scale. Use positive/negative to place the labels outside/inside the circle. Default value is -20

Parameters | Description | Equivalent java class/property
GAUGE_AXIS1_LABEL_MARGIN=7 GAUGE_AXIS2_LABEL_MARGIN=5 | Possition of the white labels are 5 pixels outside the scale. | gaugePlotter.axis1LabelMargin gaugePlotter.axis2LabelMargin

These parameters are used to change the possition of the scale:

- GAUGE_AXIS1_MARGIN (*): Margin of the main scale (in pixels). Distance in pixels between border and ticks, the default is 5.
- GAUGE_AXIS2_MARGIN (*): Margin of the second scale (in pixels). Distance in pixels between border and ticks of the second scale, the default is 40.

Parameters | Description | Equivalent java class/property
GAUGE_AXIS1_MARGIN=-4 GAUGE_AXIS2_MARGIN=20 GAUGE_AXIS1_LABEL_MARGIN=7 GAUGE_AXIS2_LABEL_MARGIN=5 | Ticks start 4 pixels outside the gauge. Ticks start 20 pixels inside the gauge. Labels are 7 pixels outside the scale.. | gaugePlotter.axis1Margin gaugePlotter.axis2Margin gaugePlotter.axis1LabelMargin gaugePlotter.axis2LabelMargin

The size of the gauge and subgauges can be defined with:

- GAUGE_RADIUS: Size of the radius gauge, Value between > 0 and < 2. Default is 1.
- GAUGE_BORDER (*): Line style of the border of the pie.

Parameters | Description | Equivalent java class/property
GAUGE_BORDER=0.2|0xff0000|NORMAL GAUGE_RADIUS=0.6 | Red border of the gauge (also GAUGE1_BORDER, GAUGE2_BORDER) Size of the gauge | gaugePlotter.border gaugePlotter.radiusModifier

- GAUGE_SUBGAUGE_SIZE: Size of the subgauges in % of the size of the main gauge. Default value is 30.

Parameters | Description | Equivalent java class/property
GAUGE_SUBGAUGE_SIZE=40 | Size of the subgauges | gaugePlotter.subGaugeSize=40;

- GAUGE_BACK(*): Background color. Default is blue.

A gauge can contain up to 2 subgauges. In order to activate the subgauges you must set GAUGE2_ENABLE:

Parameters | Description | Equivalent java class/property
GAUGE2_ENABLE=TRUE GAUGE2_START_ANGLE=0 GAUGE2_END_ANGLE=180 GAUGE2_BACK=0xffff LEGEND_MARGIN=0.3 | Activate subgauge 2 Subgauge is a semicircle (angle 0-180) |