main | examples | common questions | changes | licensing


EASYCHARTS DOCUMENTATION   :   GAUGECHART

1. Angles and Ranges
  1.1 start and end angles
  1.2 using range labels
  1.3 setting ranges
  1.4 highlighting the range
  1.4 range color

2. Labels and Fonts
  2.1 range labels font
  2.2 range labels color

3. Chart Colors
  3.1 background color
  3.2 chart background color
  3.3 foreground color
  3.4 chart foreground color
4. Pointers
  4.1 setting pointers

5. Sector Highlights
  5.1 setting sector highlights

6. Borders
  6.1 Setting gauge borders

CHART PARAMETERS
background
border
chartBackground
chartForeground
chartTitle
endAngle
edgeColor
floatingLabelColor
floatingLabelsOn
foreground
gaugeAlignment
legendBoxSizeAsFont
legendColors
legendColumns
legendFont

legendImage
legendLabels
legendOn
legendPosition
legendReverseOn
lowerRange
pointer
pointerLabels
pointerLabelsOn
pointerSize
range
rangeColor
rangeEndAnlge
rangeDecimalCount
rangeHighlight
rangeInterval
rangeLabelColor
rangeLabelFont
rangeLabelPrefix
rangeLabelPostfix
rangeLabelsOn
rangeLabelStyle
rangeStartAnlge
rangeTickSize
rangeTickStyle
sectorHighlight
startAngle

PARAMETERS TO SET CHART VALUES
startAngle
Sets the start angle of the gauge. The 0 angle corresponds to the lowest point of the gauge, 90 to the leftmost, 180 - uppermost, 270 - rightmost.
<param name="startAngle" value="90">
setStartAngle(90);
startAngle=90
endAngle
Sets the end angle of the gauge. The 0 angle corresponds to the lowest point of the gauge, 90 to the leftmost, 180 - uppermost, 270 - rightmost.
<param name="endAngle" value="270">
setEndAngle(270);
endAngle=270
rangeStartAngle
Sets the start angle of the range. The 0 angle corresponds to the lowest point of the gauge, 90 to the leftmost, 180 - uppermost, 270 - rightmost.
<param name="rangeStartAngle" value="92">
setRangeStartAngle(92);
rangeStartAngle=92
rangeEndAngle
Sets the end angle of the range. The 0 angle corresponds to the lowest point of the gauge, 90 to the leftmost, 180 - uppermost, 270 - rightmost.
<param name="rangeEndAngle" value="268">
setRangleEndAngle(268);
rangeEndAngle=268
range
Sets the highest value of the range.
<param name="range" value="200">
setRange(200);
range=200
lowerRange
Sets the lowest value of the range.
<param name="lowerRange" value="200">
setLowerRange(200);
lowerRange=200
rangeInterval
Sets interval between the ticks. <param name="rangeInterval" value=20>
setRangeInterval(20);
rangeInterval=20
rangeColor
Sets the color of the range value labels and tick marks. <param name="rangeColor" value=white>
setRangeColor(0, Color.white);
rangeColor=white
rangeHighlight
This is the highlight color of the range. <param name="rangeHighlight" value="cyan">
setRangeHighlight(Color.cyan);
rangeHighlight=cyan
rangeLabelsOn
Turns on the range labels. <param name="rangeLabelsOn" value=true>

setRangeLabelsOn(0, true);
rangeLabelsOn=true
rangeLabelFont
Sets the font for the range labels. <param name="rangeLabelFont" value="Dialog, plain, 12">
setFont("rangeLabelFont", new Font("Dialog", Font.PLAIN, 12));
rangeLabelFont=Dialog, plain, 12
rangeLabelStyle
Sets style for the range labels. The labels can be displayed inside or outside the gauge, or over the gauge border. (RANGE_LABEL_INSIDE | RANGE_LABEL_OUTSIDE | RANGE_LABEL_BORDERR). By default the range labels are displayed inside the gauge. <param name="rangeLabelStyle" value="outside">
setRangeLabelStyle(GaugeChart.RANGE_LABEL_OUTSIDE);
rangeLabelStyle=border
rangeTickSize
Sets size for the range ticks. <param name="rangeTickSize" value="12">
setRangeTickSize(12);
rangeTickSize=12
rangeTickStyle
Sets the style for the range ticks. The ticks can be displayed round, as diamonds or as a thin or thick strip. (TICK_STYLE_ROUND | TICK_STYLE_DIAMOND | TICK_STYLE_THIN | TICK_STYLE_THICK). <param name="rangeTickStyle" value="diamond">
setRangeTickStyle(GaugeChart.TICK_STYLE_DIAMOND);
rangeTickStyle=diamond
rangeLabelColor
Sets the color of the range value labels. Overrides rangeColor parameter. <param name="rangeLabelColor" value=lighGray>
setRangeLabelColor(0, Color.lightGray);
rangeLabelColor=lightGray
rangeDecimalCount
Sets the number of fixed decimals to use for the range labels.
<param name="rangeDecimalCount" value=1>
setRangeDecimalCount(0, 1); // first parameter is rangen index
rangeDecimalCount=1
floatingLabelsOn
Turns on the floating labels which are displayed when mouse over the range or the legend. When mouse over the legend the label is displayed above the corresponding pointer. <param name="floatingLabelsOn" value=true>

setFloatingLabelsOn(true);
floatingLabelsOn=true
floatingLabelColor
Sets color of the floating labels. <param name="floatingLabelColor" value=blue>

setFloatingLabelColor(Color.blue);
floatingLabelColor=blue
foreground
This is the color of the title, legend labels, range labels. <param name="foreground" value="blue">
setForeground(Color.blue);
foreground=blue
background
This is the background color of the area around the chart grid. The background can be solid or gradient. In order to use gradient background, specify two colors separated by |. <param name="background" value="red">
<param name="background" value="gray|lightGray">
setBackground(Color.red);
setBackground2(Color.black);
background=red
background=gray|lightGray
chartBackground
This is the color of the area inside the gauge. <param name="chartBackground" value="red">
setChartBackground(Color.yellow);
chartBackground=orange
chartForeground
This is the default color of elements inside the gauge. <param name="chartForeground" value="red">
setChartForeground(Color.red);
chartForeground=red
pointer
Adds a pointer with specified index (0-based) and sets it's value and color. <param name="pointer" value="60,blue">
<param name="pointer_1" value="-30,green">
setPointer(0, 60);
setPointerColor(0, Color.blue);
setPointer(1, -30);
setPointerColor(1, Color.green);
pointer=60,blue
pointer_1=-30,green
pointerLabels
Sets the pointer labels for this chart. The pointer labels will appear for each pointer when the pointerLabelsOn parameter is turned on. <param name="pointerLabels" value="one,two,three">
setPointerLabels(new String[] {"one","two","three"});
pointerLabels=one,two,three
pointerLabelsOn
Turns on the pointer labels set by the pointerLabels parameter. <param name="pointerLabelsOn" value=true>
setPointerLabelsOn(true);
pointerLabelsOn=true
pointerSize
Sets relative size of the pointer, a float value from 0.0 to 2.0, where the default value is 1.0. <param name="pointerSize" value="0.5">
<param name="pointerSize_1" value="1.2">
setPointerSize(0, 0.5);
setPointerSize(1, 1.2);
pointerSize=0.5
pointerSize_1=1.2
sectorHighlight
Sets a highlighted sector with the specified start, end values and color in the gauge's range. <param name="sectorHighlight" value="90,135,pink">
<param name="sectorHighlight_1" value="135,160,red">
setSectorHighlight(0, 90, 135);
setSectorHighlight(0, Color.pink);
setSectorHighlight(1, 135, 160);
setSectorHighlight(1, 135, 160, Color.red);
sectorHighlight=90,135,pink
sectorHighlight=135,160,red
border
Adds a border with specified index to the gauge (0-based) and sets it's width, color and second color. The second color can be used to paint gradient border. The border with higher index is displayed closer to the center of the gauge. <param name="border" value="3,black">
<param name="border_1" value="7,white,gray">
setBorder(0, 3);
setBorderColor(0, Color.black);
setBorder(1, 7);
setBorderColor(1, Color.white, Color.gray);
border=3,black
border_1=7,white,gray
edgeColor
Sets the color of the gauge edge outline if the gauge is less then 360 degrees. <param name="edgeColor" value=lighGray>
setEdgeColor(Color.black);
edgeColor=lightGray
chartTitle
Sets the title of the chart. The title will be displayed at the top of the chart. To set the title font use the titleFont parameter. Use \n for line breaks. <param name="chartTitle" value="This is my title">
<param name="chartTitle" value="Linebreak\nin title">
setTitle("This is my title");
setTitle("Linebreak\\nin title");
chartTitle=This is my title
gaugeAlignment
Sets alignment of the gauge inside the component: center, top, bottom, left, right. <param name="gaugeAlignment" value="bottom">
setGaugeAlignment(GaugeChart.GAUGE_ALIGNMENT_BOTTOM);
gaugeAlignment=bottom
rangeLabelPrefix
Adds a prefix before the range labels. <param name="rangeLabelPrefix" value="#">
<param name="rangeLabelPrefix_5" value="$">
setLabel("rangeLabelPrefix", "#");
setLabel("rangeLabelPrefix_5", "$");
rangeLabelPrefix=#
rangeLabelPrefix_5=$
rangeLabelPostfix
Adds a postfix after the range labels.
<param name="rangeLabelPostfix" value="%">
<param name="rangeLabelPostfix_5" value="@">
setLabel("rangeLabelPostfix", "%");
setLabel("rangeLabelPostfix_5", "@");
rangeLabelPostfix=%
rangeLabelPostfix_5=@
legendOn
Turns on the legend placing it at the default right position. Use the legendPosition parameter to control the placement of the legend. <param name="legendOn" value=true>
setLegendOn(true);
legendOn=true
legendLabels
Sets labels in the legend. <param name="legendLabels" value="2000, 2001, 2002">

setLegendLabels(new String[] {"2000","2001","2002"});
legendLabels=2000,2001,2002
legendPosition
Sets the legend position. Possible positions are right, left, top, and bottom. <param name="legendPosition" value="left">
setLegendPosition(BarChart.LEFT);
setLegendPosition(BarChart.RIGHT);
setLegendPosition(BarChart.TOP);
setLegendPosition(BarChart.BOTTOM);
legendPosition=bottom
legendColumns
Sets the number of columns that should be used to display legend labels. <param name="legendColumns" value=4>
setLegendColumns(3);
legendColumns=5
legendReverseOn
Set on or off the inverted legend. Default legend entry order is from top to bottom and from left to right. <param name="legendReverseOn" value=true>
setLegendReverseOn(true);
legendReverseOn=true
legendFont
Sets the font for the labels in the legend. <param name="legendFont" value="Dialog, plain, 12">
setFont("legendFont", new Font("Dialog", Font.PLAIN, 12));
legendFont=Dialog,plain,12
legendColors
Sets the colors for the default legend boxes.
<param name="legendColors" value="red, blue, green">
setLegendColors(new Color[] {Color.red, Color.blue, Color.green});
legendColors=red,blue,green
legendImage
Sets an image to be used in front of the legend label instead of the default legend box. For the applet the image is specified as a relative URL. This only works if the applet is allowed to connect back to the web server. <param name="legendImage_0" value="blue_ball.gif">
<param name="legendImage_1" value="images/red_ball.gif">
Image image = ... load image blue_ball.gif from disk
addImage("legendImage_0", image);
setLegendImage(0, "legendImage_0");
legendBoxSizeAsFont
Sets the default legend box size the same as the legend font size.
<param name="legendBoxSizeAsFont" value="true">
setLegendBoxSizeAsFont(true);
legendBoxSizeAsFont=true

CHART USER GUIDE


1. Angles and Ranges

1.1 Start and end angles.

Use startAngle and endAngle parameter to define where the start and end agles of the gauge.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=175>
<param name=chart value="gauge">
<param name=startAngle value=90>
<param name=endAngle value=270>
</applet>

1.2 Using range labels.

Use rangeLabelsOn parameter to turn on the range labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=175>
<param name=chart value="gauge">
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
</applet>

The style of the range labels can be inside or outside. Use rangeLabelStyle parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=175>
<param name=chart value="gauge">
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOnvalue=true>
<param name=rangeLabelStyle value=outside>
</applet>

1.3 Setting ranges.

Use range and lowerRange parameters to explicitly set upper and lower ranges.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value="gauge">
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=range value=150>
<param name=lowerRange value=30>
<param name=rangeDecimalCount value=1>
</applet>

1.4 Highlighting the range.

Use rangeHighlight parameter to highligh the range with specific color.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value="gauge">
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=rangeHighlight value=#208cf0>
</applet>

1.5 Range Color.

Use rangeColor parameter to set color of the range. By default color of the range is the same as chartBackground color.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value=gauge>
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=rangeColor value=gray>
</applet>


2. Labels and Fonts.

2.1 Range labels font.

Use rangeLabelFont parameter to set font of the range labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value=gauge>
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=rangeLabelFont value=Times,italic,10>
</applet>

2.2 Range labels color.

Use rangeLabelColor parameter to set color of the range labels. By default color of the range labels is the same as rangeColor.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value=gauge>
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=rangeColor value=red>
<param name=rangeLabelColor value=gray>
</applet>


3. Chart Colors


3.1 Background color

Set the background color outside the gauge itself using the background parameter. This does not include the gauge inside background.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=220>
<param name=chart value=gauge>
<param name=range value=120>
<param name=rangeLabelsOn value=true>
<param name=background value=#305b92>
</applet>


3.2 Chart background color

Set the background color inside the gauge using the background parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=220>
<param name=chart value=gauge>
<param name=range value=120>
<param name=rangeLabelsOn value=true>
<param name=rangeLabelStyle value=outside>
<param name=chartBackground value=#305b92>
</applet>


3.3 Foreground color

Set the chart component foreground color using the foreground parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=175>
<param name=chart value=gauge>
<param name=chartTitle value="foreground color set">
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=foreground value=#305b92>
</applet>


3.4 Chart foreground color

Set the foreground color of the chart grid elements.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=180>
<param name=chart value=gauge>
<param name=range value=120>
<param name=rangeLabelsOn value=true>
<param name=chartBackground value=#305b92>
<param name=chartForeground value=white>
</applet>


4. Pointers


4.1 Setting pointers

Use pointer_N parameter to set a new pointers value and color, where N is index of the pointer. Use pointer parameter to set value of 0-pointer.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=175>
<param name=chart value=gauge>
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=rangeLabelsOn value=true>
<param name=rangeDecimalCount value=1>
<param name=chartForeground value=gray>
<param name=pointer value=40,green>
<param name=pointer_1 value=15,blue>
<param name=pointer_2 value=75,cyan>
</applet>


5. Sector Highlights


5.1 Setting sector highlights

Use sectorHighlight_N parameter highlight sector of the range with the specifiņ color. N is index of the highlighted sector. Use sectorHighlight paramter for the sector with index 0.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=150>
<param name=chart value=gauge>
<param name=startAngle value=90>
<param name=endAngle value=270>
<param name=pointer value=40>
<param name=rangeLabelsOn value=true>
<param name=rangeLabelStyle value=outside>
<param name=rangeHighlight value=#208cf0>
<param name=sectorHighlight value=50,69,pink>
<param name=sectorHighlight_1 value=71,100,red>
</applet>


6. Borders


6.1 Setting gauge borders

Use sectorHighlight_N parameter highlight sector of the range with the specifiņ color. N is index of the highlighted sector. Use sectorHighlight paramter for the sector with index 0.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=220>
<param name=chart value=gauge>
<param name=rangeLabelsOn value=true>
<param name=pointer value=40>
<param name=border value=2,gray>
<param name=border_1 value=5,lightGray>
</applet>




Color names: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow



Copyright (C) 1998-2008 ObjectPlanet, Inc.
phone (+47) 2233 3360 fax (+47) 2233 3361