Skip to main content
Version: 8.1

Vision - Pie Chart

Component Palette Icon:

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 in Vision 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​

LabelValue
Grapefruit7
Apples15
Bananas56
Kiwis19

By Row​

GrapefruitApplesBananasKiwis
7155619

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
note

You can bring up a context menu for this component when right-clicking on it either in the Designer's Preview Mode or in a Vision Client. See the Charting - Right Click Menu page for more details.

Properties​

NameDescriptionProperty TypeScriptingCategory
3D Depth FactorThe depth of a 3D pie as a factor of the chart height.double.depthFactorAppearance
BorderThe border surrounding this component. Options are No border, Etched (Lowered), Etched (Raised), Bevel (Lowered), Bevel (Raised), Bevel (Double), and Field Border.
Note: The border is unaffected by rotation.

Changed in 8.1.21
As of 8.1.21, the "Button Border" and "Other Border" options are removed.
Border.borderCommon
Chart TitleAn optional title that will appear at the top of the chart.String.titleAppearance
CursorThe mouse cursor to use when hovering over this component. Options are: Default, Crosshair, Text, Wait, Hand, Move, SW Resize, or SE Resize.int.cursorCodeCommon
DataThe data driving the chart.Dataset.dataData
Enforce Circularity?If true, the pie cannot be an oval, even if the overall chart is.boolean.circularAppearance
Extract OrderControls whether or not a pie plot views columns as pies, or rows.int.extractOrderData
Foreground TransparencyThe transparency of the pie (useful for 3D pies). Valid values are between 0 (0% opacity) and 1 (100% opacity).double.foregroundAlphaAppearance
Label FontThe font for labels items, if there are labels.Font.labelFontAppearance
Label FormatFormatting String. '{0}' is the wedge name, '{1}' is the value, '{2}' is the percent.String.labelFormatAppearance
Labels?Should labels be displayed near sections?boolean.labelsAppearance
Legend FontThe font for legend items, if there is a legend.Font.legendFontAppearance
Legend?Should there be an item legend below the chart?boolean.legendAppearance
Mouseover TextThe text that is displayed in the tooltip which pops up on mouseover of this component.String.toolTipTextCommon
NameThe name of this component.String.nameCommon
Outline ColorsThe colors to use for the pie wedge outlines. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.Color[].outlineColorsAppearance
Outline VisibleWhether to display an outline around the pie chart.boolean.outlineVisibleAppearance
Outline StrokeThe width for the section outline stroke.float.outlineStrokeAppearance
Plot BackgroundThe background color for all plots, unless they override it. See Color Selector.Color.plotBackgroundAppearance
Plot InsetsThe padding to use around the actual plot rendering area.int.plotInsetsAppearance
QualityThe data quality code for any Tag bindings on this component.QualityCode.qualityData
RotationDraw the wedges clockwise or counter-clockwise from the starting angle?int.rotationAppearance
Section ColorsThe colors to use for the pie wedge fills. See Color Selector.Color[].sectionColorsAppearance
Selected WedgeThe currently selected wedge. (Read only. Usable in bindings and scripting.)String.selectedDataUncategorized
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.selectionEnabledBehavior
Selection Highlight ColorThe color of the selection highlight. See Color Selector.Color.selectionHighlightColorAppearance
Selection Highlight WidthThe line width of the selection highlight.float.selectionHighlightWidthAppearance
Starting AngleThe start angle to draw the pie wedges.int.startAngleAppearance
StyleStyle of pie chart, standard, 3D, or ring.int.styleAppearance
Title FontThe font for the chart's title.Font.titleFontAppearance
Tooltip FormatFormatting String. '{0}' is the wedge name, '{1}' is the value, '{2}' is the percent.String.tooltipFormatAppearance
Tooltips?Should tooltips be displayed when the mouse hovers over sections?boolean.tooltipsBehavior
VisibleIf disabled, the component will be hidden.boolean.visibleCommon

Scripting​

See the Vision - Pie Chart Scripting Functions page page for the full list of scripting functions available for this component.

Event Handlers​

Event handlers allow you to run a script based off specific triggers. See the full list of available event handlers on the Component Events page

Customizers​

Examples​

Code Snippet
#The following code will print named 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