NAME
piechart - Create and manipulate piechart widgets.
SYNOPSIS
piechart pathName ?options?
STANDARD OPTIONS
borderWidth font relief cursor backGround
See the ``options'' manual entry for details on the standard options.
WIDGET-SPECIFIC OPTIONS
Name: command Class: Command Command-Line Switch: -command
-
Specifies a TCL command to be periodically executed every interval milliseconds, when the callback has been started.
Name: data Class: Data Command-Line Switch: -data
-
This is a string that can be associated with each widget.
Name: explode Class: Explode Command-Line Switch: -explode
-
Specifies the label of the pie wedge that is to be pulled out from the others. The explodewidth option defines how far out to pull it.
Name: explodewidth Class: Explodewidth Command-Line Switch: -explodewidth
-
Specifies the number of pixels to pull the exploded wedge out by.
Name: interval Class: Interval Command-Line Switch: -interval
-
This specifies the time between sucessive callbacks.
Name: keyboxsize Class: Keyboxsize Command-Line Switch: -keyboxsize
-
Specifies the height / width of the coloured box in the key.
Name: keyorder Class: Keyorder Command-Line Switch: -keyorder
-
Specifies what fields are displayed in the key, and in what order. The keyorder is a string consisting of the letters K,V,P and L. These stand for Key box (the colored square), Value (the numerical value), P (the percentage of the whole) and Label (the textual label of the wedge). For example, the string KL would display only the key box followed by the label, with no numerical data displayed at all.
This option will probably change in later releases to something more like specifying a printf-style format string, with width/precision specifiers, etc.
Name: numdigits Class: Numdigits Command-Line Switch: -numdigits
-
Specifies the number of decimal places that the percentage value will display.
This option will probably be made obselete in later releases. See the note on the keyorder option.
Name: origin Class: Origin Command-Line Switch: -origin
-
Specifies the rotation of the pie, in degrees, clockwise. It specifies the angle that the line between the first wedge and the last wedge makes with the vertical. That is, if origin is 0, then there will always be a line in the `12 o-clock' position, going straight up. If it is 90, then there will be a line in the `3 o-clock' position.
Name: percentwidth Class: Percentwidth Command-Line Switch: -percentwidth
-
Specifies the width of the percent field in the key, in pixels.
This option will probably be made obselete in later releases. See the note on the keyorder option.
Name: radius Class: Radius Command-Line Switch: -radius
-
Specifies the radius of the pie.
Name: textcolor Class: Fourground Command-Line Switch: -textcolor
-
Specifies the color of the text, that is, the color of the title and the color of the text in the key. These should probably be separated into two options. Name: textwidth Class: Textwidth Command-Line Switch: -textwidth
-
Specifies the width of the label field in the key, in pixels.
This option will probably be made obselete in later releases. See the note on the keyorder option.
Name: title Class: Title Command-Line Switch: -title
-
This string is placed on the top of the widget as the widgets title. By default there is no title. Specifying a blank title ("") will remove the title.
Name: valuewidth Class: Valuewidth Command-Line Switch: -valuewidth
-
Specifies the width of the value field in the key, in pixels.
This option will probably be made obselete in later releases. See the note on the keyorder option.
DESCRIPTION
The piechart command creates a new window (given by the pathName argument) and makes it into a pie widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the pie such as its colors, font, text, and initial relief. The piechart command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A pie is a widget for displaying pie graphs. It creates a rectangular widget which contains a pie and a key. The key consists of four fields, the Key box (the colored square), Value (the numerical value), P (the percentage of the whole) and Label (the textual label of the wedge). These can be removed, duplicated or re-ordered.
WIDGET COMMAND
The piechart command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for pie widgets:
- pathName configure ?option? ?value option value ...?
-
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the piechart command.
- pathName get ?label ...?
-
Returns a list consisting of label-value pairs each label in the pie, in order specified. If none are specifed, all values are returned.
- pathName set label value ?label value ...?
-
Add a new wedge labeled label with the specified value to the pie, or modify the value of the wedge with that label.
- pathName start
-
Starts the callback routine. The Tcl command given in the -command switch is executed periodically . The period is given in the -interval switch (in milliseconds).
- pathName stop
-
Stops the callback routine.
- pie, widget