Pie Chart

General

images/download/attachments/6044936/pie.PNG

Component Palette Icon:

images/download/attachments/6044936/pie2.PNG


Description

The Pie Chart component displays a familiar-looking pie chart. A Pie Chart displays a list of named items, each of which has a value that is part of a total. The total is the sum of the value of each item. The key to the Pie Chart component is the Data property, which contains the items that will be displayed as pie wedges. Typically, this dataset will be bound to a SQL Query Binding to pull dynamic data out of an external database.

Extract Order

Similar to other charts, the pie chart can actually accept data in two formats. You can tell the pie chart which format to use via its Extract Order property. The two extract orders are By Column or By Row. The following table shows the two styles for the data that created the pie chart in the screenshot.

By Column

By Row

Label

Value

Grapefruit

7

Apples

15

Bananas

56

Kiwis

19

Grapefruit

Apples

Bananas

Kiwis

7

15

56

19

Labels

In addition to the color-coded legend, the pie chart can annotate each wedge with a label. The format of the label is controlled via the Label Format property.

For example, the format string used in the screenshot is "{0} = {2} ({3})"This is a pattern string that uses the following placeholders:

  • {0} - the item label

  • {1} - the item value

  • {2} - the item percentage

Properties

Name

Description

Property Type

Scripting

Category

3D Depth Factor

The depth of a 3D pie as a factor of the chart height

double

.depthFactor

Appearance

3D?

Deprecated. Use <b>Style</b> property instead.

boolean

.threeDimensional

Appearance

Antialias

Draw with antialias on? Makes text smoother

boolean

.antialias

Appearance

Border

The border surrounding this component. NOTE that the border is unaffected by rotation.

Border

.border

Common

Chart Title

An optional title that will appear at the top of the chart.

String

.title

Appearance

Cursor

The mouse cursor to use when hovering over this component.

int

.cursorCode

Common

Data

The data driving the chart.

Dataset

.data

Data

Data Quality

The data quality code for any tag bindings on this component.

int

.dataQuality

Data

Enforce Circularity?

If true, the pie cannot be an oval, even if the overall chart is.

boolean

.circular

Appearance

Extract Order

Controls whether or not a pie plot views columns as pies, or rows.

int

.extractOrder

Data

Foreground Transparency

The transparency of the pie (useful for 3D pies)

double

.foregroundAlpha

Appearance

Label Font

The font for labels items, if there are labels.

Font

.labelFont

Appearance

Label Format

Formatting String. '{0}' is the wedge name, '{1}' is the value, '{2}' is the percent.

String

.labelFormat

Appearance

Labels?

Should labels be displayed near sections?

boolean

.labels

Appearance

Legend Font

The font for legend items, if there is a legend.

Font

.legendFont

Appearance

Legend?

Should there be an item legend below the chart?

boolean

.legend

Appearance

Mouseover Text

The text that is displayed in the tooltip which pops up on mouseover of this component.

String

.toolTipText

Common

Name

The name of this component.

String

.name

Common

Outline Colors

The colors to use for the pie wedge outlines.

Color[]

.outlineColors

Appearance

Outline Stroke

The width for the section outline stroke.

float

.outlineStroke

Appearance

Plot Background

The background color for all plots, unless they override it

Color

.plotBackground

Appearance

Rotation

Draw the wedges clockwise or counter-clockwise from the starting angle?

int

.rotation

Appearance

Section Colors

The colors to use for the pie wedge fills.

Color[]

.sectionColors

Appearance

Selected Wedge

The currently selected wedge. (Read only. Usable in bindings and scripting.)

String

.selectedData

Uncategorized

Selection Enabled?

If true, the user will be able to select wedges on the chart. The selected wedge will be highlighted, and the "selectedData" property will reflect it.

boolean

.selectionEnabled

Behavior

Selection Highlight Color

The color of the selection highlight

Color

.selectionHighlightColor

Appearance

Selection Highlight Width

The line width of the selection highlight

float

.selectionHighlightWidth

Appearance

Starting Angle

The start angle to draw the pie wedges.

int

.startAngle

Appearance

Style

Style of pie chart, standard, 3D, or ring.

int

.style

Appearance

Title Font

The font for the chart's title.

Font

.titleFont

Appearance

Tooltip Format

Formatting String. '{0}' is the wedge name, '{1}' is the value, '{2}' is the percent.

String

.tooltipFormat

Appearance

Tooltips?

Should tooltips be displayed when the mouse hovers over sections?

boolean

.tooltips

Behavior

Visible

If disabled, the component will be hidden.

boolean

.visible

Common

Scripting
Scripting Functions

This component does not have scripting functions associated with it.

Extension Functions

This component does not have extension functions associated with it.

Event Handlers

mouse

mouseClicked

This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseEntered

This event fires when the mouse enters the space over the source component.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseExited

This event fires when the mouse leaves the space over the source component.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mousePressed

This event fires when a mouse button is pressed down on the source component.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseReleased

This event fires when a mouse button is released, if that mouse button's press happened over this component.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMotion

mouseDragged

Fires when the mouse moves over a component after a button has been pushed.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMoved

Fires when the mouse moves over a component, but no buttons are pushed.

.source

The component that fired this event

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

propertyChange

propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

.source

The component that fired this event

.newValue

The new value that this property changed to.

.oldValue

The value that this property was before it changed. Note that not all components include an accurate oldValue in their events.

.propertyName

The name of the property that changed. NOTE: remember to always filter out these events for the property that you are looking for! Components often have many properties that change.

Customizers
Examples
Code Snippet
#The following code will print namd and value of the selected wedge to the console.
#Alternatively this can be used to write to a custom property of a table that is used to create the 'Where' clause of a SQL query that populates a table.
 
selectedWedge = event.source.selectedData
print selectedWedge