Vvidget Code Reference Manual

Vvidget Code > Dictionary > Illustration

Making a graph is a matter of forming a sequence of key value pairs and entering them into a dictionary. The dictionary is the minimum definition of each graph type and from there other mechanisms embellish the graph. This section deals only with the dictionary entries corresponding with each graph type.

For example, making a line graph dictionary is illustrated by this code fragment:

/* Start of Illustration Code Fragment */

[constructor VC_append_key:"chart_type" string_value:@"line"];
[constructor VC_append_key:"chart_subtype" string_value:@"linear"];
[constructor VC_append_key:"chart_format_type" string_value:@"default"];

[constructor VC_append_key:"title" string_value:@"Vvidget Illustration"];
[constructor VC_append_key:"x_title" string_value:@"Illustration Domain"];
[constructor VC_append_key:"y_title" string_value:@"Illustration Range"];

[constructor VC_append_key:"data_1" string_value:@"1 5 2 10 3 4 4.2 1.2"];

[constructor VC_append_key:"line_color" string_value:@"0000FF"];

/* End of Illustration Code Fragment */

If you are unfamiliar with Cocoa programming then you should first read the Cocoa Programming Tutorial. Once you read that then the following Illustration project should be like a cookie cutter prescription to place different graph types into your application.

You can download an Illustrative project called (er...) Illustration by clicking this link: Illustration.zip. As you can imagine, it illustrates the dictionary concept and all you need do is copy and paste any illustration code fragment, as shown within this manual, to achieve a running application for the graph type as defined by the illustration. Illustration code fragments, which you can copy and paste into the Illustration project, are shown in the specific dictionary sections, for example the Line Graph Dictionary section.

The figure below shows the content of the Illustration project. It is a normal Cocoa Application project and can be built in the usual way.

Directory Contents Of Illustration Project

If you look into the IllustrationAppDelegate.m file (perhaps by using Xcode) then you will find the clearly marked Illustration code fragment section.

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.