Vvidget Code Reference Manual

Vvidget Code > Extraordinary Dictionary > Stock Chart

This section explains how to form a dictionary for a stock chart such as this:

Example

There is not really anything extraordinary about a stock chart except for the following. The dictionary that forms this chart bears little resemblance to the graphics of the chart. Whereas the normal Dictionary keys directly relate to the graph, the keys for this Stock Chart example relate only to domain specific criterion of the problem at hand. This important distinction between generic and non-generic keys is what distinguishes commodity processing from specialized processing.

Although it is of little value in a generic situation, this capability is of paramount importance in exacting situations where custom programming of the dictionary processing is required.

An example code fragment illustration follows:

/* Start of Illustration Code Fragment */

[constructor VC_append_key:"pvs_version" string_value:@"1"];
[constructor VC_append_key:"image_maker" string_value:@"stock_chart"];
[constructor VC_append_key:"image_width" string_value:@"800"];
[constructor VC_append_key:"image_height" string_value:@"600"];
[constructor VC_append_key:"ticker_symbol" string_value:@"DJIA"];
[constructor VC_append_key:"start_month" string_value:@"1"];
[constructor VC_append_key:"start_day_of_month" string_value:@"1"];
[constructor VC_append_key:"start_year" string_value:@"2010"];
[constructor VC_append_key:"end_month" string_value:@"1"];
[constructor VC_append_key:"end_day_of_month" string_value:@"1"];
[constructor VC_append_key:"end_year" string_value:@"2011"];

/* 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 symbol form follows:

[constructor VC_append_key:"pvs_version" string_value:@"1"];
[constructor VC_append_key:"image_maker" string_value:@"stock_chart"];
[constructor VC_append_key:"image_width" string_value:@"WIDTH"];
[constructor VC_append_key:"image_height" string_value:@"HEIGHT"];
[constructor VC_append_key:"ticker_symbol" string_value:@"TICKER"];
[constructor VC_append_key:"start_month" string_value:@"MM"];
[constructor VC_append_key:"start_day_of_month" string_value:@"DD"];
[constructor VC_append_key:"start_year" string_value:@"YYYY"];
[constructor VC_append_key:"end_month" string_value:@"MM"];
[constructor VC_append_key:"end_day_of_month" string_value:@"DD"];
[constructor VC_append_key:"end_year" string_value:@"YYYY"];

The following table defines the dictionary key and value pairs:

Chart Specific Entries
KeyValue Description
image_makerAlways stock_chart indicating a Stock Chart.
image_widthThe width of the chart.
image_heightThe height of the chart.
ticker_symbolThe ticker symbol to process.
start_monthThe start month.
start_day_of_monthThe start day.
start_yearThe start year.
end_monthThe end month. The end date must always be greater than the start date.
end_day_of_monthThe end day. The end date must always be greater than the start date.
end_yearThe end year. The end date must always be greater than the start date.

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.

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.