Vvidget Code Reference Manual

Vvidget Code > Dictionary > Overview

Making a graph is a matter of forming a sequence of key value pairs. That sequence is called a dictionary. The dictionary can be constructed in various forms with a Cocoa Objective-C API being a common one.

For example, this pie chart:

Example

was made with Vvidget Code via this Objective-C API:

/* Start of Illustration Code Fragment */

constructor = [graphView get_VC_input_string_constructor];
[constructor VC_append_key:"chart_type" string_value:@"pie"];
[constructor VC_append_key:"chart_subtype" string_value:@"0"];
[constructor VC_append_key:"chart_format_type" string_value:@"1"];
[constructor VC_append_key:"data_values" string_value:@"1 3 4 5 6"];
[constructor VC_append_key:"fill_color" string_value:@"AAAA00"];

/* End of Illustration Code Fragment */

The same pie chart can also be made at the command line with this script:

#!sh
###############################################################
# Run like:
# sh make_figures.sh
###############################################################

/Library/Vvidget/Helpers/vvizard -s << EOF
add pvs_version 1
add image_width 200
add image_height 200
add image_maker chart
add chart_type 5
add chart_subtype 0
add chart_format_type 1
add data_values 1 3 4 5 6
add fill_color AAAA00
save png example1.png
quit
EOF

or through a serialized string such as this (NOTE: this form is not too important in regards to Vvidget Code and it is primarily used for other purposes for which it is important):

image_maker=chart&image_output_type=1&image_width=200&image_height=200&chart_type=5&chart_subtype=0&
chart_format_type=1&data_values=1%203%204%205%206&fill_color=AAAA00

The Objective-C API is for Cocoa applications, the scripting API is for scripts and CLI utilities and the serialized string is used for the Interface Builder Inspector input and some other uses. The commonality between the forms is apparent. The Objective-C form is discussed in the Cocoa Programming section and the script form is discussed in the Script Programming section. The third form, string serialization, is discussed in the Web Programming section. Note that Web programming is a valid Cocoa programming paradigm since it uses WebView to image the graph. That type of programming is considered a SOA desktop client application, hence the concept is a part of this manual.

Any which way, the calling code eventually calls upon API to build a dictionary which is then used to make a graph. In fact, all of the figures in this manual are generated by the script form in one way or another and the process in the script, vvizard, is written using the Vvidget Code API.

The rest of this chapter deals with dictionary entries and their specification and how to incorporate those specifications in the various end uses. To see a representative specification see Line Graph.

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.