All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----java.awt.Panel | +----java.applet.Applet | +----com.objectplanet.gui.PieChartApplet
A simple piechart applet can be created with the following tag:
<applet com.objectplanet.gui.PieChartApplet width=300 height=200
archive=com.objectplanet.gui.PieChartApplet.jar>
<param name="sampleValues" value="100,200,300,400,500">
<applet>
To set a chart value or feature, use the following tag
<param name="parameterName" value="valueToUse">
SAMPLE VALUES | ||
Parameter | Type | Description |
sampleValues | decimal array |
Sets the sample values for the first data series. If the sampleCount is not set
the number of samples in the chart will be the number of values set. <param name="sampleValues" value="10.5, 30.5, 20, 5.1234"> |
sampleCount | integer |
Sets the number of samples in the chart. This will override the number
of values set with the sampleValues parameter. <param name="sampleCount" value=5> |
seriesCount | integer |
Sets the number of data series in the chart. You must set this to read more
than one series of data (using the sampleValues_N parameter). <param name="seriesCount" value=4> |
sampleValues_N | decimal array |
Sets the sample values for the specified data series. <param name="seriesCount" value=4> <param name="sampleValues_0" value="200,100,300,250,400"> <param name="sampleValues_1" value="300,150,200,150,300"> <param name="sampleValues_2" value="100,50,350,300,350"> <param name="sampleValues_3" value="400,200,100,400,200"> |
LABELS AND FONTS |
||
Parameter | Type | Description |
chartTitle | string |
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. <param name="chartTitle" value="This is my title"> |
sampleLabels | string array |
Sets the sample labels for this chart. The sample labels will appear
in the legend by setting the legendOn parameter to true, or floating
above each pie slice when you move the mouse over if you set the
sampleLabelsOn parameter to true. <param name="sampleLabels" value="monday, tuesday, wednesday, thursday, friday"> |
seriesLabels | string array |
Sets the series labels for this chart. The series labels will appear
in the legend when multiple data series are used and legendOn is
turned on. <param name="seriesLabels" value="1997, 1998, 1999"> |
legendLabels | string array |
Overrides the default labels in the legend. The default labels are either
the sampleLabels (if 1 data series is used) or the seriesLabels
(if multiple data series is used). <param name="legendLabels" value="1997, 1998, 1999"> <param name="legendLabels" value="sampleLabels"> <param name="legendLabels" value="seriesLabels"> |
labelDelimiter | string |
By default the sampleLabels, seriesLabel, and legendLabels use
comma (,) as a field delimiter. Use this parameter to control the
label delimiter if you need a comma in the labels to be displayed. <param name="labelDelimiter" value=":"> |
valueLabelPrefix | string |
Adds a prefix before all value labels. You can also set the prefix for
individual data series by adding the series index. <param name="valueLabelPrefix" value="$"> <param name="valueLabelPrefix_0" value="£"> <param name="valueLabelPrefix_1" value="€"> |
valueLabelPostfix | string |
Adds a postfix after all value labels. You can also set the postfix for
individual data series by adding the series index. <param name="valueLabelPostfix" value="%"> <param name="valueLabelPostfix_0" value="ms"> <param name="valueLabelPostfix_1" value="ns"> |
font | font string |
Sets the default font for the chart. <param name="font" value="Dialog, plain, 12"> |
titleFont | font string |
Sets the title font. <param name="titleFont" value="Dialog, bold, 20"> |
legendFont | font string |
Sets the font for the labels in the legend. <param name="legendFont" value="Dialog, plain, 12"> |
floatingLabelFont | font string |
Sets the font used with the floating sample/value/percent labels. <param name="floatingLabelFont" value="Dialog, plain, 12"> |
pieLabelFont | font string |
Sets the font to use for the pie labels. The pie labels are displayed
below each pie if multiple pies are used and pieLabelsOn is true. <param name="pieLabelFont" value="Dialog, bold, 12"> |
COLORS |
||
Parameter | Type | Description |
sampleColors | color array |
Sets the colors of the pie slices in the chart. <param name="sampleColors" value="red, green, blue, orange, magenta"> |
sampleLabelColors | color array |
Sets the colors of the sample labels in the legend. <param name="sampleLabelColors" value="red, green, blue, orange, magenta"> |
seriesLabelColors | color array |
Sets the colors of the series labels in the legend. <param name="seriesLabelColors" value="red, green, blue, orange, magenta"> |
background | color |
This is the background color of the chart applet. <param name="background" value="red"> |
foreground | color |
This is the color of the title and legend labels <param name="foreground" value="blue"> |
sliceSeperatorColor | color |
Controls the slice seperator color. If this is not set, the color used
is the same as the slice color, only a little darker. <param name="sliceSeperatorColor" value="black"> |
STYLE |
||
Parameter | Type | Description |
legendOn | boolean |
Turns on the legend. The default position of the legend is to the right
of the chart. <param name="legendOn" value=true> |
legendPosition | string |
Sets the legend position. Possible positions are right, left, top,
and bottom. <param name="legendPosition" value="left"> |
3DModeOn | boolean |
Set this parameter to true to paint the chart in 3D. <param name="3DModeOn" value=true> |
sampleLabelsOn | boolean |
By turning the sample labels on, the sample label for a pie segment will
appear floating on top of the segment when the mouse pointer moves across
the segment or the sample label in the legend. <param name="sampleLabelsOn" value=true> |
valueLabelsOn | boolean |
By turning the value labels on, the value for a pie segment will appear
floating on top of the segment when the mouse pointer moves across
the segment or the sample label in the legend. <param name="valueLabelsOn" value=true> |
percentLabelsOn | boolean |
By turning the percent labels on, the percentage for a pie segment will
appear floating on top of the segment when the mouse pointer moves across
the segment or the sample label in the legend. <param name="percentLabelsOn" value=true> |
pieLabelsOn | boolean |
The pie labels are displayed below each pie if multiple series/pies
are used. The labels displayed are the sample labels. <param name="pieLabelsOn" value=true> |
sampleDecimalCount | integer |
Sets the number of fixed decimals to use for the value labels. <param name="sampleDecimalCount" value=3> |
percentDecimalCount | integer |
Sets the number of fixed decimals to use for the percent labels. <param name="percentDecimalCount" value=3> |
angle | integer |
Sets the angle of the 3D pie. Possible values are 10-90.
The default value is 30. <param name="angle" value=30> |
depth | decimal |
Sets the depth of the 3D pie. Possible values are 0.0-1.0.
The default value is 0.4. <param name="depth" value="0.2"> |
sliceSeperatorOn | boolean |
Turns on the seperator lines between the slices in the pie(s). By
default, the color of those lines is the same as the slice, only
a little darker to create the seperator effect. <param name="sliceSeperatorOn" value="true"> |
selectionStyle | string |
Sets the effect painted when the user selects a pie slice or a series
in the legend. The effects available is a triangle or circle marker
within the pie slice, or detaching the slice as it is selected. <param name="selectionStyle" value="detached"> <param name="selectionStyle" value="triangle"> <param name="selectionStyle" value="circle"> |
detachedDistance | decimal |
Controls the distance the slices are detached from the pie. The value
is a factor of the pie radius, so if the parameter value is set to 0.5,
the slice is detached halfway out of the pie. <param name="detachedDistance" value="0.2"> |
MISCELLANEOUS |
||
Parameter | Type | Description |
url_N_M | url |
This feature can be used to create drill-down functionallity for the
charts. You can associate any pie slice or series in the chart to a URL,
and the document pointed to by that URL will be opened when the
user double-clicks the pie slice or label in the legend.
The N is the index of the data series (first is numbered 0). The M is the index of the sample within the series (first is numbered 0). If there is only one series in the chart, N will be the index of the sample. However url_0_M will override url_N if M=N.
<param name="url_0" value="orange_sales_1999.html"> |
urltarget_N_M | string |
This parameter controls where HTML pages will be opened. urltarget - sets the default target frame or window urltarget_N - sets the target for the specified series urltarget_N_M - sets the target for the specified sample
_self: Open new page in same window or frame. |
detachedSlices_N | decimal array |
Detaches the specified slices in pie number N. <param name="detachedSlices" value="0,3"> <param name="detachedSlices_0" value="0,3"> <param name="detachedSlices_1" value="5"> |
graphInsets | integer array |
Use this parameter to add space between the pie(s) and the chart
component edges. The parameter consists of 4 comma seperated integers,
whith the following sequence; top, left, bottom, right. A value of -1
uses the default inset. <param name="graphInsets" value="-1, 50, -1, -1"> |
automaticRefreshTime | integer |
Some web browsers has problems repainting applets correctly and causes
"breaks" in the applet graphics. Use this parameter to repaint the
chart periodically to repair these breaks in the charts. The value
of the parameter is in milliseconds (1000 = 1 second). <param name="automaticRefreshTime" value="1000"> |
PARAMETER VALUE TYPES |
||
Parameter Type | Description | |
string | A text string between double quotes. | |
integer | An integer number, positive or negative (-100 or 100). | |
decimal | An integer or floating point number, positive or negative (-100.5 or 100.32). | |
boolean | true or false. | |
string array | A comma seperated set of strings between double quotes ("string1, string2, string3"). | |
decimal array | A comma seperated set of integer or floating point numbers between double quotes ("-100.5, 10, 100.12, 233.4234"). | |
color |
A named color, a color triplet, or a 6-digit hex code. The named colors
are (black, blue, cyan, darkGray, gray, green, lightGray, magenta,
orange, pink, red, white, and yellow). value="red" value="50,100,150" (red, green, blue, <= 255) value="#a07f00" (#RRGGBB, 00-ff) |
|
color array |
A string of named colors or a 6-digit hex code between double quotes.
The named colors are (black, blue, cyan, darkGray, gray, green,
lightGray, magenta, orange, pink, red, white, and yellow). value="red, green, blue, yellow, #a0b0c0, #ff00ee" |
|
font string | "fontName, plain/bold/italic/bolditalic, size" | |
url |
A complete or relative URL between double quotes. value="http://www.thisismyurl.com/thisismypage.html" |
public PieChartApplet()
public void init()
public void setAutomaticRepaintOn(boolean state)
public void setParameter(String name, String value)
public void invalidate()
public final void update(Graphics g)
public final void paint(Graphics g)
protected void render(Graphics g)
public boolean handleEvent(Event event)
public void start()
public void stop()
public void run()
All Packages Class Hierarchy This Package Previous Next Index