Vvidget Code > Dictionary > Pie Chart
This section explains how to form a dictionary for a pie chart such as these:
Labeled Monocolor | Extruded | Extruded And Exploded | Flat Classic (Default) |
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 */
|
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 | |
Key | Value 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_values | Data 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_I | A 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_color | A 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. |
templates | A 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 | |
Template | Description |
PVST_Pie_Chart | Forms the static attributes for this chart type. |
PVST_Custom_Label_Pie_Chart | Forms 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_table | Forms the data color attributes (wedge fill colors) for odd format type indices. |
PVST_pie_color_table_1 | Forms 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. |