JWAVE User Guide > JWAVE Convenience Wrappers > JWAVE_PIE Function   
  

JWAVE_PIE Function   
This JWAVE wrapper function provides a convenient interface to the PV‑WAVE PIE_CHART procedure.This function always returns a Viewable object (a pie chart) to the JWAVE Java client.
Parameters
This section lists the parameters that the JWAVE_PIE wrapper can retrieve, unpack, and use to produce a pie chart. These parameters correspond to the parameters and keywords of the PV‑WAVE PIE_CHART2 procedure. You must set these parameters in the client application with the JWaveView.setParam method.
Y—(required) A 1D array of values to plot (30 maximum).
Keyword Parameters
This section lists the keyword parameters that can be retrieved and unpacked in this wrapper function.
Charsize—Relative character size. (Default: 1.0)
Explode—Explode (move out from center). Normalized displacement of each slice from the center (between 0 and 1). Must be an array with the same length as X, if supplied. (Default: 0 for all slices)
Label—Text labels for each slice. If specified, must be an array of strings the same length as X.
Radius—Normalized radius of pie chart. Between 0 and 0.5. (Default: 0.3)
Tborder—Draw borders around the labels. A boolean 0 or 1. (Default: 0)
Tperct—Add notation of percentage of each slice to the label. A boolean 0 or 1. (Default: 0)
Tvalue—Add notation of value of each slice to label. A boolean 0 or 1. (Default: 0)
Tposition—Label positions: 0 = Internal to the slice, 1 = External, 2 = External Aligned.
Xcenter, Ycenter—Normalized position of the center of the chart. Between 0 AND 1. (Default: 0.5, 0.5)
Shade—Draw a shadow under chart. Normalized displacement of shadow from the center of the chart (between 0 and 1). (Default: no shadow)
Named Color Parameters
These parameters must be set by the JWAVE client Java application with the JWaveView.setNamedColor method.
Background—The background color. (Default: black)
Color—Color for lines (pie outline) and title text. (Default: white)
Tbord_Color—Color for the label border (if Tborder is set). (Default: the value of the Color keyword)
Named ColorSet Parameters
These parameters must be set by the JWAVE client Java application with the JWaveView.setNamedColorSet method.
Slices—Color for each slice. If specified, must have the same number of colors as there are data points in X. (Default: shades of gray)
Tcolor—Color for the label of each slice. If specified, must have the same number of colors as there are data points in X. (Default: slices)
Returns
This wrapper returns a Viewable object (of a pie chart) to the JWAVE Java client application.
Example
In the client Java application, the setParam method is used to set the parameters to be passed to this JWAVE wrapper on the server. JWAVE_PIE unpacks the parameters and builds a PV‑WAVE PIE_CHART command to produce a pie chart.
These lines of Java code set the name of the wrapper function and some parameters. These lines of code would appear in the JWAVE client application.
JWaveView myJWaveView = new JWaveView(connection, ”JWAVE_PIE”) 
myJWaveView.JWaveView.setParam(”Y”, piedata); 
myJWaveView.JWaveView.setParam(”CHARSIZE”, 2);
myJWaveView.JWaveView.setParam(”TITLE”, ”Relative Weights”); 
myJWaveView.setNamedColor(”BACKGROUND”, java.awt.Color.blue); 
See Also
For more information on using JWAVE wrapper functions, see JWAVE Server Development.
For more information on the PV‑WAVE PIE_CHART procedure, see the PV‑WAVE Reference.

Version 3.6
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.