It is possible to get model values to be used in the titles and labels of the Custom Graphs, Custom Tables and Custom Reports. For example in the above XY plot we might have replaced the old title "Workforce Versus Inventory (xy)" with
Workforce/Inventory with Inventory Correction @
\Time Correct Inventory&*1/ and \Time Correct Inventory&*2/
resulting in the plot:
The ability to display variable values in graphs is most powerful in Venapps because you can display String variables replacing them with names that a Venapp user may have typed in.
To display a variable value surround the name of the variable a backslash \ followed by a forward slash / what is between the slashes will be interpreted as a variable. Included in the \/ can be specifiers for the dataset, Time at which the value will be chosen, formatting for the variable and even substitute strings for the variable. You control what is displayed by using a special character to separate the specifiers. The & in the above example precedes the run name (the wildcards *1 and *2). A variable name can be followed by the following specifiers:
& runname
Names the dataset to find the variable in. You can name a run explicitly, or use *1, *2 ... to name the first loaded run, second loaded run and so on. If this is left blank the first loaded dataset will be used.
# time base
Specifies the time base used to find the value for the variable. If this is not specified the currently selected Time Base (normally Time) will be used.
@ time
Specifies the time at which the number will be reported. This time should be measured in the Time Base chosen. If no time is specified the value at the currently set Special Time as shown in the Time Axis control will be used.
%format
Specifies the format in which the string will be written. The format specification follows standard C language practice. Numbers are always reported using floating point. Typical options might be
%.0f - show 0 decimal places (no decimal .)
%.4f - show 4 decimal places
%8.3g - use eight spaces showing 3 significant digits
If no format is specified Vensim's standard pretty number format will be used.
?value=label
The value relabeling option lets you put out special numbers as special strings. For example if you have a variable that is on or off you might use
\financial restraint switch?0=Low?1=High/
The ?value=label sequence should appear last. It can contain &, #, @ and % and these will be treated as literal values, and not as special characters.
You do not need to use any of the above controls. Just the variable name displays the variable in the first loaded run at special time and displayed as a Vensim formatted number or, in the case of String Variables, as a string without the surrounding single quotes. For example using the labeling:
Would result in the legend markings:
Where
pname[p1] :IS: 'Super Sudser' ~~|
pname[p2] :IS: 'Brass Polish' ~~|
Note that the name displayed is that from the simulation run, not from the model.
NOTE If Vensim cannot find the variable you have named it will put out two dashes --.