RiskResultsGraph

Description

RiskResultsGraph(cellRef or output/input name, locationCellRange,graphType, xlFormat, leftDelimiter, rightDelimiter, xMin, xMax, xScale, title, sim#) adds a graph of simulation results to a worksheet.  The graph generated is the same as generated in the Results Summary window. Many arguments to this function are optional. If optional arguments are not entered, the function creates a graph using the current default settings in the Results Summary window for any omitted argument.

Examples

RiskResultsGraph(A10) generates a graph of the simulation results for cell A10 as a graph in @RISK format at the location of the function, using the default graph type (histogram, cumulative ascending, or cumulative descending).

RiskResultsGraph(A10,C10:M30,0,TRUE,1,99) generates a graph of the simulation results for cell A10 in the range C10:M30 as a histogram in Excel format, and sets the left and right delimiters at the 1% and 99% percentile values, respectively.

Guidelines

cellRef is any valid Excel cell reference with one or more cells. Either a cellRef or an output/input name argument must be included in a RiskResultsGraph function. When cellRef is entered, the results to be graphed depend on the following:

If there is a RiskOutput function in cellref, the simulation results for this output will be graphed.

If there is no RiskOutput function in cellRef, but there is a distribution function, the function will graph the collected samples for this input.

If there is no RiskOutput function and no distribution function in cellRef, a RiskOutput function is automatically added and this output is graphed.

If there are multiple cells in cellRef, an overlay graph is created for the simulation results for each cell in cellRef. Each overlay has the same graphType.

locationCellRange is any valid Excel cell range. The created graph will be located in and sized according to this cell range.

graphType (optional) is one of the following constants:

0 for histogram

1 for cumulative ascending graph

2 for cumulative descending graph

3 for tornado graph of regression sensitivity results

4 for tornado graph of correlation sensitivity results

5 for a summary graph of 1) the output range that includes cellRef or 2) the results for each cell in cellRef (where cellRef is a multi-cell range)

6 for a box plot of 1) the output range that includes cellRef or 2) the results for each cell in cellRef (where cellRef is a multi-cell range)

7 for a graph of a theoretical distribution function

8 for a histogram of a simulated input overlaid with its theoretical distribution

9 for a histogram with a cumulative ascending overlay

10 for a histogram with a cumulative descending overlay

11 for tornado graph of mapped value sensitivity results

12 for a scatter plot graph of the results for each cell in cellRef (where cellRef is a multi-cell range)

13 for histogram using relative frequency

14 for tornado graph of change in output statistic

15 for a spider graph

16 for a relative frequency histogram with a cumulative ascending overlay

17 for a relative frequency histogram with a cumulative descending overlay

18 for a relative frequency histogram of a simulated input overlaid with its theoretical distribution

19 for tornado graph of contribution to variance

20 for letter value graph

xlFormat (DEPRECATED) (optional) specifies whether the graph will be created as an Excel format chart. Enter TRUE for an Excel format chart; enter FALSE, or leave blank, for an @RISK format chart.

This option has been deprecated, and will result in an error if set to TRUE. This option has only been preserved for compatibility with models created in previous versions.

leftDelimiter (optional) specifies the location of the left delimiter on the graph in % (for histograms and cumulative graphs only). leftDelimiter is a value from 0 to 100.

rightDelimiter (optional) specifies the location of the right delimiter on the graph in % (for histograms and cumulative graphs only). rightDelimiter is a value from 0 to 100.

xMin (optional) specifies the minimum value for the X-axis in unscaled units (for histograms and cumulative graphs only). If used, it must be used in conjunction with xMax.

xMax (optional) specifies the maximum value for the X-axis in unscaled units for histograms and cumulative graphs only. If used, it must be used in conjunction with xMin.

xScale (optional) specifies the scale factor for the X-axis (for histograms and cumulative graphs only). xScale is an integer value representing the power of 10 used to convert the X-axis values when labeling the axis. For example, a value of 3 for xScale specifies that values should be shown in thousands.

title (optional) specifies the graph title shown on the graph. A string in quotes, or cell reference containing the title, can be entered.

sim# (optional) specifies simulation number for which results are to be graphed when multiple simulations are run. Use '0' to overaly all simulations.