main | documentation | examples | common questions | changes | licensing


EASYCHARTS DOCUMENTATION   :   PIECHART

1. Loading Data
  1.1 sample values
  1.2 sample count
  1.3 empty values
  1.4 multiple data series
  1.5 dynamically loading data
  1.6 loading data from a url

2. Labels and Fonts
  2.1 chart title
  2.2 sample labels
  2.3 series labels
  2.4 legend labels
  2.5 value labels
  2.6 percent labels
  2.7 pie labels
  2.8 anywhere labels

3. Chart Colors
  3.1 sample colors
  3.2 background color
  3.3 foreground color

4. Chart Style
  4.1 3D mode
  4.2 selection style
  4.3 detached slices
  4.4 slice seperator

5. Miscellaneous
  5.1 urls and drilldown
  5.2 graph insets

CHART PARAMETERS
3DModeOn
angle
antialias
automaticRefreshTime
background
chart
chartClass_pie
chartTitle
data
dataInterval
depth
detachedDistance
detachedSlices
doubleBufferingOff
floatingLabelFont
floatingOnLegendOff
font
foreground
gradientSamplesOn
graphInsets
insideLabelFont
insideLabelColor
jpegQuality
labelDelimiter
label
labelAngle
labelColor
labelFont
labelPosition
labelURL
labelURLTarget
legendBoxSizeAsFont
legendColors
legendFont
legendColumns
legendImage
legendLabels
legendOn
legendPosition
legendReverseOn
output
locale
outsideLabelFont
outsideLabelColor
percentDecimalCount
percentLabelsOn
percentLabelStyle
pieLabelFont
pieLabelsOn
pieRotationOn
pointingLabelFont
pointingLabelColor
printAsBitmap
sampleColors
sampleCount
sampleDecimalCount
sampleLabelColors
sampleLabels
sampleLabelsOn
sampleLabelStyle
sampleValues
selectionStyle
seriesCount
seriesLabelColors
seriesLabels
seriesLabelsOn
singleClickURLOn
sliceSeperatorColor
sliceSeperatorOn
startAngle
titleFont
thousandsDelimiter
valueLabelPrefix
valueLabelPostfix
valueLabelsOn
valueLabelStyle
url_default
url_N_M
urltarget

PARAMETERS TO SET CHART VALUES
sampleValues
Sets the values of the pie. Only positive values can be used in the pie chart. If multiple data series are used, there will be one pie per sample set, and the number of slices per pie is the number of data series used. <param name="sampleValues" value="10.5, 30.5, 20, 5.1234">
setSampleValues(0, new double[] {10.5,30.5,20,5.1234});
sampleValues=10.5,30.5,20,5.1234
sampleCount
Sets the number of pie slices if one data series is used or number of pies if multiple data series are used. <param name="sampleCount" value=5>
setSampleCount(5);
sampleCount=5
seriesCount
Sets the number of data series in the chart. If multiple data series are used, the slices in each pie will represent one data series. Set the values per data series with the sampleValues_N parameter. <param name="seriesCount" value=3>
setSeriesCount(3);
seriesCount=3
sampleValues_N
Sets the sample values for the specified data series. You must set the series count first. <param name="sampleValues_0" value="200,100,300,250,400">
<param name="sampleValues_1" value="300,150,200,150,300">
setSampleValues(0, new double[] {200,100,300,250,400});
setSampleValues(1, new double[] {300,150,200,150,300});
sampleValues_0=200,100,300,250,400
sampleValues_1=200,100,300,250,400

PARAMETERS TO SET LABELS
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
titleFont
Sets the font used for the chart title. <param name="titleFont" value="Dialog, bold, 20"
setFont("titleFont", new Font("Dialog", Font.BOLD, 20));
titleFont=Dialog, bold, 20
sampleLabels
Sets the sample labels for this chart. The sample labels appears in the legend, as tooltip like labels when the mouse moves over the pie slices or as static labels within each slice. Use the legendOn, sampleLabelsOn, and sampleLabelStyle parameter to control how the labels are displayed. <param name="sampleLabels" value="one,two,three,four">
setSampleLabels(new String[] {"one","two","three","four"});
setSampleLabel(0, "first label");
setSampleLabel(1, "second label");
sampleLabels=one,two,three,four
sampleLabelColors
Sets the colors of the sample labels displayed in the legend. <param name="sampleLabelColors" value="red, #7f0000, blue">
setSampleLabelColor(0, Color.red);
setSampleLabelColor(1, new Color(0x7f0000));
setSampleLabelColor(2, Color.blue);
sampleLabelColors=red,%237f0000,blue
seriesLabels
Sets the series labels for this chart. The series labels are displayed in the legend when multiple data series are used. <param name="seriesLabels" value="2000,2001,2001">
setSeriesLabels(new String[] {"2000","2001","2002"});
setSeriesLabel(0, "first label");
seriesLabels=2000,2001,2002
seriesLabelColors
Sets the colors of the series labels in the legend. <param name="seriesLabelColors" value="red, #7f0000, blue">
setSeriesLabelColor(0, Color.red);
setSeriesLabelColor(1, new Color(0x7f0000));
setSeriesLabelColor(2, Color.blue);
seriesLabelColors=red,%237f0000,blue
legendOn
Turns on the legend. The legend displays the sample labels or series labels depending on the value of the seriesCount parameter. <param name="legendOn" value=true>
setLegendOn(true);
legendOn=true
legendPosition
Sets the legend position. Possible positions are right, left, top, and bottom. Default position is right. <param name="legendPosition" value="right">
<param name="legendPosition" value="left">
<param name="legendPosition" value="top">
<param name="legendPosition" value="bottom">
setLegendPosition(PieChart.RIGHT);
setLegendPosition(PieChart.LEFT);
setLegendPosition(PieChart.TOP);
setLegendPosition(PieChart.BOTTOM);
legendPosition=left
legendLabels
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="2000, 2001, 2002">
<param name="legendLabels" value="sampleLabels">
<param name="legendLabels" value="seriesLabels">
setLegendLabels(new String[] {"2000","2001","2002"});
legendLabels=2000,2001,2002
legendLabels=sampleLabels
legendLabels=seriesLabels
legendFont
Sets the font for the labels used 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. If this is not set, the colors are taken from the sampleColors parameter. <param name="legendColors" value="red, #7f0000">
Color[] c = new Color[] {Color.red, new Color(0x7f0000));
setLegendColors(c);
legendColors=red,%237f0000
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
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
labelDelimiter
By default the sampleLabels, seriesLabel, and legendLabels parameters 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 in the applet or servlet. <param name="labelDelimiter" value=":">
labelDelimiter=:
thousandsDelimiter
Use this parameter to control the thousands delimiter in numerical labels. <param name="thousandsDelimiter" value=",">
setThousandsDelimiter(",");
thousandsDelimiter=,
locale
Sets the locale of the chart. The locale affects the display of value and range labels, with the correct grouping and decimal signs.
Language codes
Country codes
<param name=locale value="en, gb">
<param name=locale value="en, us">
setLocale(new Locale("EN", "GB");
setLocale(new Locale("EN", "US");
locale=en,gb
locale=en,us
sampleLabelsOn
By turning on the sample labels, 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. The sample labels can also be displayed statically by using the sampleLabelStyle parameter. <param name="sampleLabelsOn" value=true>
setSampleLabelsOn(true);
sampleLabelsOn=true
sampleLabelStyle
The sample labels can be displayed floating over the pie slices, statically inside the slices, outside the slices or pointing to the slices. <param name="sampleLabelStyle" value="floating">
<param name="sampleLabelStyle" value="inside">
<param name="sampleLabelStyle" value="outside">
<param name="sampleLabelStyle" value="pointing">
setSampleLabelStyle(Chart.FLOATING);
setSampleLabelStyle(Chart.INSIDE);
setSampleLabelStyle(Chart.OUTSIDE);
setSampleLabelStyle(Chart.POINTING);
sampleLabelStyle=inside
sampleLabelStyle=outside
sampleLabelStyle=pointing
seriesLabelsOn
By turning on the series labels, the series labels for a pie segment will appear floating on top of the segment when the mouse pointer moves across the segment or the label in the legend. The series labels can also be displayed statically inside each slice by using the seriesLabelStyle parameter. <param name="seriesLabelsOn" value=true>
setSeriesLabelsOn(true);
seriesLabelsOn=true
seriesLabelStyle
The series labels can be displayed floating over the pie slices,statically inside the slices, outside the slices or pointing to the slices. <param name="seriesLabelStyle" value="floating">
<param name="seriesLabelStyle" value="inside">
<param name="seriesLabelStyle" value="outside">
<param name="seriesLabelStyle" value="pointing">
setSeriesLabelStyle(PieChart.FLOATING);
setSeriesLabelStyle(PieChart.INSIDE);
setSeriesLabelStyle(PieChart.OUTSIDE);
setSeriesLabelStyle(PieChart.POINTING);
seriesLabelStyle=inside
seriesLabelStyle=outside
seriesLabelStyle=pointing
valueLabelsOn
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. The value labels can also be displayed statically by using the valueLabelStyle parameter. <param name="valueLabelsOn" value=true>
setValueLabelsOn(true);
valueLabelsOn=true&valueLabelStyle=inside
valueLabelStyle
The value labels can be displayed floating over the pie slices, statically inside the slices, outside the slices or pointing to the slices. <param name="valueLabelStyle" value="floating">
<param name="valueLabelStyle" value="inside">
<param name="valueLabelStyle" value="outside">
<param name="valueLabelStyle" value="pointing">
setValueLabelStyle(Chart.FLOATING);
setValueLabelStyle(Chart.INSIDE);
setValueLabelStyle(Chart.OUTSIDE);
setValueLabelStyle(Chart.POINTING);
valueLabelsOn=true&valueLabelStyle=inside
valueLabelsOn=true&valueLabelStyle=outside
valueLabelsOn=true&valueLabelStyle=pointing
sampleDecimalCount
Sets the number of fixed decimals to use for the value labels. <param name="sampleDecimalCount" value=3>
setSampleDecimalCount(3);
sampleDecimalCount=3
floatingOnLegendOff
By default floating labels are displayed for all the samples in the selected series when the mouse moves over a series label in the legend. This parameter turns this behavior off. <param name="floatingOnLegendOff" value="true">
setFloatingOnLegendOn(false);
valueLabelPrefix
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_2" value="£">
setLabel("valueLabelPrefix", "$");
valueLabelPrefix=$
valueLabelPostfix
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">
setLabel("valueLabelPostfix", "%");
setLabel("valueLabelPostfix_1", "ms");
valueLabelPostfix=KB
percentLabelsOn
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. The percent labels can also be displayed statically by using the percentLabelStyle parameter. <param name="percentLabelsOn" value=true>
setPercentLabelsOn(true);
percentLabelsOn=true&percentLabelStyle=inside
percentLabelStyle
The percent labels can be displayed floating over the pie slices, statically inside the slices, outside the slices or pointing to the slices. <param name="percentLabelStyle" value="floating">
<param name="percentLabelStyle" value="inside">
<param name="percentLabelStyle" value="outside">
<param name="percentLabelStyle" value="pointing">
setPercentLabelStyle(Chart.FLOATING);
setPercentLabelStyle(Chart.INSIDE);
setPercentLabelStyle(Chart.OUTSIDE);
setPercentLabelStyle(Chart.POINTING);
percentLabelsOn=true&percentLabelStyle=inside
percentLabelsOn=true&percentLabelStyle=outside
percentLabelsOn=true&percentLabelStyle=pointing
percentDecimalCount
Sets the number of fixed decimals to use for the percent labels. <param name="percentDecimalCount" value=3>
setPercentDecimalCount(3);
percentDecimalCount=3
floatingLabelFont
Sets the font used with the floating sample/value/percent labels. <param name="floatingLabelFont" value="Dialog, plain, 12">
setFont("floatingLabelFont", new Font("Dialog",Font.PLAIN,12));
insideLabelFont
Sets the font used with the sample/value/percent labels when inside each pie slice. <param name="insideLabelFont" value="Dialog, plain, 12">
setFont("insideLabelFont", new Font("Dialog",Font.PLAIN,12));
insideLabelFont=Dialog,plain,12
insideLabelColor
Sets the color used for the inside labels for all pies. To set the inside label colors per pie use the insideLabelColor_N parameter <param name="insideLabelColor" value="blue">
<param name="insideLabelColor_4" value="red">
setInsideLabelColor(-1, black);
setInsideLabelColor(2, blue);
insideLabelColor=red
insideLabelColor_4=green
outsideLabelFont
Sets the font used with the sample/value/percent labels when outside each pie slice. <param name="outsideLabelFont" value="Dialog, plain, 12">
setFont("outsideLabelFont", new Font("Dialog",Font.PLAIN,12));
outsideLabelFont=Dialog,plain,12
outsideLabelColor
Sets the color used for the outside labels for all pies. To set the outside label colors per pie use the outsideLabelColor_N parameter <param name="outsideLabelColor" value="blue">
<param name="outsideLabelColor_4" value="red">
setOutsideLabelColor(-1, black);
setOutsideLabelColor(2, blue);
outsideLabelColor=red
outsideLabelColor_4=green
pointingLabelFont
Sets the font used with the sample/value/percent labels when pointing tp each pie slice. <param name="pointingLabelFont" value="Dialog, plain, 12">
setFont("pointingLabelFont", new Font("Dialog",Font.PLAIN,12));
pointingLabelFont=Dialog,plain,12
pointingLabelColor
Sets the color used for the pointing labels for all pies. To set the pointing label colors per pie use the pointingLabelColor_N parameter <param name="pointingLabelColor" value="blue">
<param name="pointingLabelColor_4" value="red">
setPointingLabelColor(-1, black);
setPointingLabelColor(2, blue);
pointingLabelColor=red
pointingLabelColor_4=green
pieLabelsOn
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>
setPieLabelsOn(true);
pieLabelsOn=true
pieLabelFont
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">
setFont("pieLabelFont", new Font("Dialog", Font.BOLD, 12));
pieLabelFont=Dialog,bold,12
font
Sets the default font for the chart. <param name="font" value="Dialog, plain, 12">
setFont(new Font("Dialog",Font.PLAIN,12));
font=Dialog,plain,12

PARAMETERS TO CONTROL COLORS
sampleColors
Sets the colors of the pie slices in the chart. <param name="sampleColors" value="red, green, orange">
setSampleColors(new Color[] {Color.red, Color.green, Color.orange});
sampleColors=red,green,orange
gradientSamplesOn
Turns on/off gradent color effect on the pies. This parameter is on by default. <param name="gradientSamplesOn" value="false">
setGradientSamplesOn(false);
gradientSamplesOn=false
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
foreground
This is the color of the title and legend labels. <param name="foreground" value="blue">
setForeground(Color.blue);
foreground=blue

PARAMETERS TO CONTROL CHART STYLE
3DModeOn
Displays the chart in 3D mode. <param name="3DModeOn" value=true>
set3DModeOn(true);
3DModeOn=true
angle
Sets the angle of the 3D pie. Possible values are 10-90. The default angle is 30. <param name="angle" value=30>
setAngle(30);
angle=30
startAngle
Sets the angle of the initial starting point of the slices. Value range is from -360 to 360. The default angle is 0. <param name="startAngle" value=45>
setStartAngle(45);
setStartAngle(-1, 20);
angle=45
depth
Sets the depth of the 3D pie. The depth is relative to the pie width and ossible values are 0.0-1.0. The default depth is 0.4. <param name="depth" value="0.2">
setDepth(0.2);
depth=0.2
sliceSeperatorOn
Displays a line between the slices in a pie. You can set the color of the lines using the sliceSeperatorColor parameter. <param name="sliceSeperatorOn" value="true">
setSliceSeperatorOn(true);
sliceSeperatorOn=true;
sliceSeperatorColor
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">
setSliceSeperatorColor(Color.black);
sliceSeperatorColor=yellow
selectionStyle
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">
setSelectionStyle(PieChart.SELECTION_STYLE_CIRCLE);
setSelectionStyle(PieChart.SELECTION_STYLE_TRIANGLE);
setSelectionStyle(PieChart.SELECTION_STYLE_DETACHED);
detachedSlices
Detaches slices in the pie. The slices are specified as a comma seperated list of slice numbers. Detached slices in a specific pie by specifying the pie number in the parameter. <param name="detachedSlices" value="0,3">
<param name="detachedSlices_0" value="0,3">
<param name="detachedSlices_1" value="5">
int serie=0;
int slice=3;
double distance=0.2;
setDetachedSlice(serie, slice, distance);
detachedSlices=0,3
detachedSlices_0=0,3
detachedSlices_1=5
detachedDistance
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">
setDetachedDistance(0.2);
detachedDistance=0.2
graphInsets
Use this parameter to add space between the chart grid and the chart component edges. The parameter value consists of 4 parameters whith the following sequence; top, left, bottom, right. A value of -1 uses the default inset. <param name="graphInsets" value="-1, 50, -1, -1">
setGraphInsets(-1,50,-1-1);
graphInsets=-1,50,-1,-1
pieRotationOn
Controls if the pie can be rotated by user. If the parameter is on, user can rotate the pie by dragging mouse pointer over it. <param name="pieRotationOn" value="true">
setPieRotationOn(true);

MISCELLANEOUS PARAMETERS
data
Instead of loading the data from the applet or servlet parameters, you can specify a url to load the data from. Any parameters specified in the applet or servlet tag will override parameters with the same name loaded from the url. <param name=data value=customers.asp>
data=http://somehost/customers.asp

The data in the url has to be returned in the following format
parameter1=value1
parameter2=value2
parameter3=value3

dataInterval
You can make the applet load the data from the currently specified URL at a specific interval. The interval is specified in seconds. If reset is specified in the data interval, the chart is reset before the parameters are read again. <param name=dataInterval value=10>
<param name=dataInterval value=10,reset>
chart
Use this parameter to set the type of the chart. The supported types are bar, line and pie. The default chart type is bar. <param name="chart" value="pie">
chart=pie
url_default
You can associate the chart to a URL, and the document pointed to by that URL will be opened when the user double-clicks any place inside the chart grid. Single-click can be used instead by setting the singleClickURLOn parameter. <param name="url_default" value="sales_2004.html">

Include MAYSCRIPT in the applet tag to call javascript functions.
url_N_M (applet drilldown)
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. Single-click can be used instead by setting the singleClickURLOn parameter.

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. If you want to associate and url with a group of samples with the same index across the different series use url_x_N where N is the index of data series.

<param name="url_0" value="orange_sales_2001.html">
<param name="url_1" value="apple_sales_2001.html">
<param name="url_2" value="banana_sales_2001.html">
<param name="url_3" value="http://www.fruitorama.com">
<param name="url_4" value="javascript:winOpen('bar.html', 200,500);">

Include MAYSCRIPT in the applet tag to call javascript functions.
urltarget_N_M (applet drilldown)
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.
_parent: Open in the parent window.
_top: Open in the top-level window.
_blank:Open in a new blank window.
name:Open in the frame or window with the specified name.
<param name="urltarget" value="bottom_frame">
<param name="urltarget_0" value="left_frame">
label_N
This parameter can be used to set a label to any point of the chart. N - index of the label. First parameter is label text. Second and third parameters are X and Y coordinates of the label. If X and Y are higher then 0 and lower than 1, the label position is calculated relatively to the chart bounds. Otherwise, the absolute coordinates of the chart are used. There are optional 4th and 5th parameters which are index and serie of the sample, pointed by the label. <param name="label_0" value="orange sales,100,100">
<param name="label_1" value="apple sales,0.4,0.5">
<param name="label_2" value="banana sales,200,200,4,0">

setLabel("label_0", "orange sales", 100, 100);
setLabel("label_1", "apple sales", 0.4, 0.5);
setLabel("label_2", "banana sales", 200, 200, 4, 0);

label_0=orange sales,100,100
label_1=apple sales,0.4,0.5
label_2=banana sales,200,200,4,0
labelPosition_N
This parameter can be used to set a new position for an existion label. The initial position for a label can be set by using label_N parameter. N is the index of the label. <param name="labelPosition_0" value="0.8, 0.1">
<param name="labelPosition_1" value="120, 180">

setLabelPosition("label_0", 0.8, 0.2);
setLabelPosition("label_1", 120, 180);
labelAngle_N
This parameter can be used to set angle of the given anywhere label. <param name="labelAngle_0" value="270">
<param name="labelAngle_1" value="45">
setLabelAngle("label_0", 270);
setLabelAngle("label_1", 45);
labelAngle_0=270
labelAngle_1 =45
labelColor_N
This parameter can be used to set color of the given anywhere label. <param name="labelColor_0" value="red">
<param name="labelColor_1" value="#4f6c23">
setLabelColor("label_0", Color.red);
setLabelColor("label_1", new Color(0x4f6c23));
labelColor_0=red
labelColor_1 =%234f6c23
labelFont_N
This parameter can be used to set font of the given anywhere label. <param name="labelFont_0" value="Dialog,plain,10">
<param name="labelFont_1" value="Times,italic,12">
setFont("label_0", new Font("Dialog", Font.PLAIN, 10));
setFont("label_1", new Font("Times", Font.ITALIC, 12));
labelFont_0=Dialog,plain,10
labelFont_1 =Times,italic,12
labelURL_N
This parameter can be used to assign an URL to an anywhere label. The URL adress will be opened when user clicks the label. N is the index of the label. <param name="labelURL_0" value="orange_sales_2001.html">
<param name="labelURL_1" value="apple_sales_2001.html">
<param name="labelURL_2" value="banana_sales_2001.html">
labelURLTarget_N
This parameter controls where a HTML page will be opened when clicked the appropriate label. labelURLTarget sets the default target frame or window. labelURLTarget_N sets the target for the specified label. _self: Open new page in same window or frame.
_parent: Open in the parent window.
_top: Open in the top-level window.
_blank:Open in a new blank window.
name:Open in the frame or window with the specified name.
<param name="labelURLTarget" value="bottom_frame">
<param name="labelURLTarget_0" value="left_frame">
singleClickURLOn (applet drilldown)
Turn on this parameter to use single click instead of double clicks when doing drilldown charts. <param name="singleClickURLOn" value="true">
automaticRefreshTime
Some browsers has problems repainting the applets when scrolling the web page. Set this parameter to make the applet repaint itself on a regular basis. The value is specified in milliseconds so 1000 is one second. <param name="automaticRefreshTime" value=1000>
doubleBufferingOff
By default the charts use double buffering to avoid flickering. However, sometimes this causes problems repainting the charts when scrolling in a browser. If you have charts that the user will not interact with, you might want to turn the double buffering off. <param name="doubleBufferingOff" value=true>
chartClass_pie
The ChartApplet wraps a PieChart class which actually renders the chart. To add more behavior you can subclass the PieChart class and make the applet load your chart class instead of the standard PieChart class. <param name="chartClass_pie" value="package.MyPieChart">
printAsBitmap
Some java VMs and printers have problems printing applets. Use the printAsBitmaps parameter to print the chart as a bitmap image to work around this. However, the resolution of the printed chart will degrade. <param name="printAsBitmap" value="true">
setPrintAsBitmap(true);

SERVLET PARAMETERS
antialias
The servlet supports antialias rendering to smooth out edges. antialias=true
jpegQuality
The servlet supports controllig quality of the returned jpeg image. jpegQuality=100
output
This paramtere can be used to force the servlet output type. Can be image or html. If the parameter value is html, the servlet output is html code that contains call to the servlet itself producing the chart image. If the value is image, the output is jpeg or png image. output=html
output=image

CHART USER GUIDE


1 Loading Data

Data can be loaded using the applet parameters.

1.1 Sample values

Use the sampleValues parameter to load data into the applet. The applet code below creates a pie chart and loads the values 10,20,30,40, and 50. The sample count of the chart will equal the number of values in the sampleValues parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
</applet>


1.2 Sample count

You can set the sample count explisitly by using the sampleCount parameter. The chart below sets the sample count to 10, but only sets the 5 first samples.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleCount value="10">
<param name=sampleValues value="10,20,30,40,50">
</applet>


1.3 Empty values

You can have empty values by using an undefined number (any sign that's not a valid number).

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,x,40,50">
</applet>


1.4 Multiple data series

A chart can have multiple data series. When the chart has multiple data series the number of pies will equal the number of samples, and the number of segments per pie will equal the number of data series.

Use the seriesCount parameter to control the number of data series, and the sampleValues_N parameter to set the values per data series.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
</applet>


1.5 Dynamically loading data

Since the applet can not connect directly to a data source, any data that has to be loaded dynamically has to be generated on the server side.

Use a scripting language on the web server (such as ASP) to read the data from a data base (or any other data source) and construct the applet code using the values read. Then the web page is sent to the client with the dynamically data ready to load into the applet.

<%
'## this function prints out the count for each department separated by comma
function PrintDepartmentCount(ByRef employeeRS)
   While Not employeeRS.EOF
      Response.Write employeeRS("DepartmentCount") & ","
      employeeRS.MoveNext
   Wend
end function

'## open data connection
set DbConn=server.createobject("adodb.connection")
cnpath="DBQ=" & server.mappath("employees.mdb")
'Response.Write cnpath
DbConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath 

'## Let's say we have one table with employees. One of the columns
'## is the department name, and the table name is employee
	
'## The following lines gets the number of employees for each department
Sql = "SELECT COUNT(*) AS DepartmentCount, Department 
FROM Employee GROUP BY Department ORDER BY Department"
Set employeeRS = DbConn.Execute(Sql)
%>

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=640 height=200>
<param name=chart value="pie">
<param name=sampleValues value="<%call PrintDepartmentCount(employeeRS)%>">
</applet>

See here for full ASP example.


1.6 Loading data from a url

If you want to load the applet or servlet data and parameters from a url, you need specify the url in the data parameter in your applet or servlet tag as below

Applet:

<applet code=com.objectplanet.chart.PieChartApplet
 archive=Chart.jar width=200 height=140>
<param name=data value="parameters.data">
</applet>

You can also configure the applet to load data from the currently specified data URL at a specific interval.

<applet code=com.objectplanet.chart.PieChartApplet
 archive=Chart.jar width=200 height=140>
<param name=data value="parameters.data">
<param name=dataInterval value="10">
</applet>

The above applet will reload the parameters.data file at 10 second intervals. If you specify a new data parameter in the parameters.data file, this file will be loaded instead on the next interval.

<param name=dataInterval value="10,reset">

This will make the applet reset all it's data before the new data is loaded.

Servlet:

<img src="http://localhost:8080/servlet/com.objectplanet.chart.ChartServlet?
chart=pie&
width=200&
height=140&
data=http://somehost/parameters.data">

Only an applet can load the data from a URL. The parameters.data file looks like this:

sampleValues_0=47,38,85,36,85
sampleColors=yellow, orange, pink, red, magenta

The data url can point to a script that produces the data as long as the format returned is as in the example above.

If you need to pass parameters to the script when using servlets, & for parameter separation and = for parameter value assignment can not be used. Instead you need to use ¤ as the parameter separator and * for the equals sign.

<img src="http://localhost:8080/servlet/com.objectplanet.chart.ChartServlet?
chart=pie&
width=200&
height=140&
data=http://somehost/somescript.xyz?myparam*value¤anotherparam*anothervalue&
background=white">


2. Labels and Fonts

2.1 Chart title

The chartTitle parameter adds a label at the top center of the chart.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=chartTitle value="chart title">
</applet>

You can have multiline labels by using a \n (goes for all chart labels).

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=chartTitle value="chart\ntitle">
</applet>

The titleFont parameter sets the font used for the title.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=chartTitle value="chart title">
<param name=titleFont value="Courier, bold, 20">
</applet>


2.2 Sample labels

You can add a label to each pie segment in the chart by using the sampleLabels parameter. The sample labels can either be displayed floating above each pie segment when the mouse moves over (default), statically inside each pie slice, or in the legend.

Turn on the sample labels using the sampleLabelsOn paramter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
</applet>

Use the sampleLabelStyle parameter to control how the labels are displayed. For labels inside the pie slices, use "inside", for floating labels, use "floating".

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,15,20,25,28">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=sampleLabelStyle value=inside>
</applet>

Use the insideLabelFont parameter to control the font used for the static labels displayed inside each pie slice.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,15,20,25,28">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=sampleLabelStyle value=inside>
<param name=insideLabelFont value="Arial, plain, 9">
</applet>

Use the floatingLabelFont parameter to control the font used for the floating labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=floatingLabelFont value="Arial, bold, 16">
</applet>

Use sampleLabelStyle=outside to show sample labels outside the pie.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,15,20,25,28">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=sampleLabelStyle value=outside>
<param name=outsideLabelFont value="Arial, plain, 9">
</applet>

Use sampleLabelStyle=pointing to show sample labels pointing to the slices.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=250 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,15,20,25,28">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=sampleLabelStyle value=pointing>
<param name=pointingLabelFont value="Arial, bold, 12">
</applet>



Use the sampleLabelColors to control the color of the sample labels in the legend.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelColors value="red, black, blue, black, magenta">
<param name=legendOn value="true">
</applet>



The default label field delimiter used is comma (,). If you want commas in your labels, you need to set a different label field delimiter. The label delimiter has effect on the sample labels, series labels, and legend labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=labelDelimiter value=":">
<param name=sampleLabels value="jan, 2001:feb, 2001:mar, 2001:apr, 2001:may, 2001">
<param name=sampleLabelsOn value=true>
</applet>


2.3 Series labels

When using multiple data series you set a label for each data series using the seriesLabels parameter. The legend will display the series labels instead of the sample labels as in a chart with one data series.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=seriesLabels value="Data A,Data B,Data C">
<param name=legendOn value=true>
</applet>

Use the seriesLabelsOn parameter to turn on floating series labels. When using multiple data series you set a label for each data series using the seriesLabels parameter. The legend will display the series labels instead of the sample labels as in a chart with one data series.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=sampleLabels value="one,two,three,four">
<param name=sampleLabelsOn value=true>
<param name=seriesLabels value="Data A,Data B,Data C">
<param name=seriesLabelsOn value=true>
<param name=legendOn value=true>
</applet>

Use seriesLabelStyle to display the series labels inside the pie slices.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=sampleLabels value="one,two,three,four">
<param name=sampleLabelsOn value=true>
<param name=seriesLabels value="A,B,C">
<param name=seriesLabelsOn value=true>
<param name=seriesLabelStyle value=inside>
</applet>

Use the seriesLabelColors to set the colors of the series labels in the legend.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=seriesLabels value="Data A,Data B,Data C">
<param name=seriesLabelColors value="black, red, black">
<param name=legendOn value=true>
</applet>


2.4 Legend labels

The legend is turned on using the legendOn parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=legendOn value=true>
</applet>

The legend position is controlled using the legendPosition parameter. The position can be right (default), left, top, or bottom.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=220 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=legendOn value=true>
<param name=legendPosition value=left>
</applet>



Control the font used for the legend labels using the legendLabels parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=legendOn value=true>
<param name=legendFont value="Arial, bold, 14">
</applet>

By default the legend contains the sample labels when one data series is used or the series labels when multiple data series is used. You can override this by using the legendLabels parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=legendLabels value="legend1,legend2,legend3">
<param name=legendOn value=true>
</applet>

Any legend box may be replaced by an image.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=sampleLabels value="one,two,three,four,five">
<param name=sampleLabelsOn value=true>
<param name=legendLabels value="legend1,legend2,legend3">
<param name=legendOn value=true>
<param name=legendImage_0 value="images/blue-ball.gif">
<param name=legendImage_1 value="images/cyan-ball-small.gif">
<param name=legendImage_2 value="images/magenta-ball.gif">
</applet>


2.5 Value labels

Turn on the value labels using the valueLabelsOn parameter. The value labels is displayed floating above each pie segment when the mouse moves over it.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=valueLabelsOn value="true">
</applet>

Use the valueLabelStyle parameter to display the value labels statically inside each pie slice, outside each pie slice or pointing to the pie slices.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=valueLabelsOn value="true">
<param name=valueLabelStyle value="inside">
</applet>

Use the sampleDecimalCount parameter to control the number of decimals used for the value labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="76.8, 76.5, 43.7, 87.8, 67.6">
<param name=valueLabelsOn value="true">
<param name=valueLabelStyle value="inside">
<param name=sampleDecimalCount value="1">
</applet>

You can add a prefix and postfix to the value labels using the valueLabelPrefix and valueLabelPostfix parameters.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=valueLabelsOn value="true">
<param name=valueLabelStyle value="inside">
<param name=valueLabelPrefix value="$">
</applet>


2.6 Percent labels

Use the percentLabelsOn parameter to turn on floating percent labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=percentLabelsOn value="true">
</applet>

Use the percentDecimalCount to control the number of decimals used for the percent labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=percentLabelsOn value="true">
<param name=percentDecimalCount value="2">
</applet>

Use the percentLabelStyle parameter to display the percent labels statically inside each pie slice.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="20,30,40,50">
<param name=percentLabelsOn value="true">
<param name=percentLabelStyle value="inside">
</applet>


2.7 Pie labels

If multiple data series are used in the chart the sample labels can be displayed below each pie by turning the pieLabelsOn parameter.

Use the pieLabelFont parameter to set the font for these labels.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=sampleLabels value="one,two,three,four">
<param name=pieLabelsOn value=true>
<param name=pieLabelFont value="Arial, bold, 14">
</applet>


2.8 Anywhere labels

You can set any label at any place by using label_N parameter. The parameter takes absolute or relative coordinates.

<applet code=com.objectplanet.chart.ChartApplet
 width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=label_0 value="label 1, 10, 20">
<param name=label_1 value="label 2, 0.5, 0.8">
<param name=label_2 value="label 3, 0.7, 0.6">
</applet>

The label can point to any sample if you specify the index and series of the sample. In this case the label can be dragged using the mouse.

<applet code=com.objectplanet.chart.ChartApplet
 width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=label_0 value="label 1, 10, 20, 4, 0">
<param name=label_1 value="label 2, 0.5, 0.8">
</applet>

An URL adress can be assigned to a label using labelURL_N parameter. In this case a new web page is opened when user clicks the label.

<applet code=com.objectplanet.chart.ChartApplet
 width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=label_0 value="label 1, 10, 20, 0, 0">
<param name=label_1 value="label 2, 0.5, 0.8">
<param name=labelURL_0 value="objectplanet.com">
<param name=labelURL_1 value="www.objectplanet.com/EasyCharts">
</applet>


3. Chart Colors

3.1 Sample colors

Use the sampleColors parameter to set the colors of the pie slices. If you have multiple data series, the sampleColors will set the color for each data serie. You can use the color names or html hex codes for the colors as in the example below.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="20,25,30,35">
<param name=sampleColors value="yellow, orange, red, #c00000">
</applet>

If you have multiple data series, the colors set is per data serie.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value=3>
<param name=sampleValues_0 value="72,87,65,78">
<param name=sampleValues_1 value="79,67,54,65">
<param name=sampleValues_2 value="23,45,45,74">
<param name=sampleColors value="yellow, orange, red">
<param name=seriesLabels value="Data A,Data B,Data C">
<param name=legendOn value="true">
</applet>


3.2 Background color

Set the chart component background color using the background parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=background value="white">
</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=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=foreground value="blue">
<param name=chartTitle value="chart foreground set">
</applet>


4. Chart Style

Through the applet parameters you can control how the chart is displayed.

4.1 3D mode

Turn on 3D mode with the 3DModeOn parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=3DModeOn value="true">
</applet>

Set the 3D display angle by using the angle parameter. Valid value range for the angle parameters is 10-90. Default is 30.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=3DModeOn value="true">
<param name=angle value="60">
</applet>

Set the 3D display depth by using the depth parameter. The depth is relative to the width of the pie and ranges from 0.0-1.0. The default depth is 0.4.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=3DModeOn value="true">
<param name=angle value="60">
<param name=depth value="0.1">
</applet>

4.2 Selection style

By default when a pie slice is selected, the slice is marked with a triangle inside the pie slice. You can control this selection marker by using the selectionStyle parameter.

The different styles are triangle, circle, or detached.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=selectionStyle value="circle">
</applet>

4.3 Detached slices

You can detach pie slices using the detachedSlices and detachedSlices_N parameter (where N is the pie index).

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=detachedSlices value="0,2">
</applet>

You can control the distance a pie slice is detached using the detachedDistance parameter. The detach distance is relative to the pie size with a value of 1.0 being detached fully.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=detachedSlices value="1">
<param name=detachedDistance value="0.25">
</applet>

4.4 Slice seperator

By default a seperator line is displayed between each pie slice. You can turn this off by turning the sliceSeperatorOn parameter to off.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,10,10">
<param name=sliceSeperatorOn value="false">
</applet>

By default, the color of the slice seperator is a hint darker than the pie slices it seperates. You can control the color of the seperators using the sliceSeperatorColor parameter.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=sampleValues value="10,10,10">
<param name=sliceSeperatorColor value="black">
</applet>


5. Miscellaneous


5.1 URLs and drilldown

You can add a URL or javascript call to any pie slice or data series in the chart and have the applet open a new web page when the user double-clicks the slice or legend entry. You must include the MAYSCRIPT parameter in the applet tag if you want to call javascript functions.

Have the url point to a web page containing another chart to create drilldown charts.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140 MAYSCRIPT>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=url_0 value="chart1.html">
<param name=url_1 value="chart2.html">
<param name=url_2 value="javascript:winOpen('pie.html', 200,500);">
</applet>

The parameter url_0 adds a URL to the first slice in the above example. Use the parameter url to add a default url to all the samples.

In a chart having multiple data series, the url_N parameter adds a url to series N. The parameter url_N_M adds a url to sample M in data series N.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=200 height=140>
<param name=chart value="pie">
<param name=seriesCount value="2">
<param name=sampleValues_0 value="10,20,30,40,50">
<param name=sampleValues_1 value="20,30,40,50,60">
<param name=url_0_0 value="chart1.html">
<param name=url_1_0 value="chart2.html">
</applet>

You can also set the URLs programatically by calling setParameter("url_0", "myurl");

You can put a URL label to any place in the chart and have applet open a new web page when user clicks the label.

<applet code=com.objectplanet.chart.ChartApplet
 archive=chart.jar width=300 height=200>
<param name=chart value="pie">
<param name=sampleValues value="10,20,30,40,50">
<param name=multiColorOn value=true>
<param name=label_0 value="url one, 35, 30">
<param name=label_1 value="url two, 85, 90">
<param name=label_2 value="url three, 140, 60">
<param name=label_3 value="url four, 190, 120">
<param name=label_4 value="url five, 245, 150">
<param name=labelURL_0 value="bar_url_sub.html#one">
<param name=labelURL_1 value="bar_url_sub.html#two">
<param name=labelURL_2 value="bar_url_sub.html#three">
<param name=labelURL_3 value="bar_url_sub.html#four">
<param name=labelURL_4 value="bar_url_sub.html#five">
</applet>

The parameter urltarget, urltarget_N, urltarget_N_M adds a target window where the new web page should be opened. The parameter labelURLTarget and labelURLTarget_N specifies the target widow for the anywhere labels with URLs. The default behavior is to open the new page in the same window.

The different parameter values are:

_self: Open new page in same window or frame.
_parent: Open in the parent window.
_top: Open in the top-level window.
_blank:Open in a new blank window.
name:Open in the frame or window with the specified name.

Use the singleClickURLOn parameter to use single click drilldowns.


5.2 Graph insets

The sizing of the pie is calculated based on the size and position of other elements in the chart and the pie height relative to its width. For a pie to have the same width in 2D and 3D, you can set the graphInsets parameter.

<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=200 height=140 VIEWASTEXT>
<param name=sampleValues value="10,20,30,40,50">
</applet>

<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=200 height=140 VIEWASTEXT>
<param name=sampleValues value="10,20,30,40,50">
<param name=3dModeOn value=true>
<param name=angle value=60>
<param name=depth value=0.1>
</applet>

<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=200 height=140 VIEWASTEXT>
<param name=sampleValues value="10,20,30,40,50">
<param name=3dModeOn value=true>
<param name=angle value=60>
<param name=depth value=0.1>
<param name=graphInsets value="-1,40,-1,40">
</applet>




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



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