Vvidget Code Reference Manual

Vvidget Code > Dictionary > Pie Chart

This section explains how to form a dictionary for a pie chart such as these:

Labeled MonocolorExtrudedExtruded And ExplodedFlat Classic (Default)
ExampleExampleExampleExample

A pie chart is a representation of relative numbers. Each number is added and then divided by the sum and then represented as pie sections (wedges) on a circular area. The pies may appear exploded, extruded, segmented or gradient filled, etc. If you give a wedge a transparent color then the pie might look like a semi-circle or some such thing. In the end, all the forms are just a pie chart and represent the same thing. The most stoic pie chart is the asset allocation chart which, in order to be really conservative, must only have three wedges. If you modify the template for the pie chart appropriately then you can make some very visually appealing looking pie charts, but still: a pie chart.

An example code fragment illustration follows:

/* Start of Illustration Code Fragment */

[constructor VC_append_key:"chart_type" string_value:@"pie"];
[constructor VC_append_key:"chart_subtype" string_value:@"default"];
[constructor VC_append_key:"chart_format_type" string_value:@"default"];
[constructor VC_append_key:"data_values" string_value:@"1 2 3 4 5"];
[constructor VC_append_key:"fill_color" string_value:@"0000FF"];

/* End of Illustration Code Fragment */

The code fragment above can be inserted into the illustration code section of the Illustration project for an immediate running Cocoa application. For additional information consult the Illustration section.

The following table defines the dictionary key and value pairs:

Chart Specific Entries
KeyValue Description
chart_type¹The chart type is the string pie, indicating a pie chart.
chart_subtype¹The chart subtype is always the string default.
chart_format_type¹One of the strings {labeled , extruded, extruded-exploded, default} which produces the varied results of the figures above.
data_valuesData values is a white space delimited list of values representing the proportional arc of the wedge. See Data Oriented keys for additional information and keys.
label_IA string for the I-th label value where I starts at 1. The label is position next to the midsection of a wedge arc.
fill_colorA hex encoded representation of a RGBA color value. This only is in effect for format type 1. If this key is not present then the color table template is used.
templatesA custom Templates directory.

¹ Do not include this key value pair in the Interface Builder Plugin Inspector input string. It is included for you automatically.

If you incorporate this functionality into your own application then please consult Cocoa Programming. If you incorporate this functionality into CLI scripts then please consult Script Programming.

You can also modify the following Templates:

Template Document Names
TemplateDescription
PVST_Pie_ChartForms the static attributes for this chart type.
PVST_Custom_Label_Pie_ChartForms the static attributes for a pie chart when a label_I key is contained in the dictionary. This is differentiated from PVST_Pie_Chart to account for potential label text in area surrounding the pie wedges.
PVST_pie_color_tableForms the data color attributes (wedge fill colors) for odd format type indices.
PVST_pie_color_table_1Forms the data color attributes (wedge fill colors) for even format type indices.

Please help improve this documentation. If a section is hard to understand, there is a typo, you would like a new section added, or you detect any other improvement that can be made then please email support@vvi.com with your information.




© Copyright 1993-2011 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.