Add Method (Graphs)
Syntax
Graphs.Add GraphType[, Depth][ , Vertical]
Applies To
Discussion
A Graph object is the same as a display in the user interface.
Use the following list to set the Graph object type:
- 0 (Crosstab)
- 1 (Pie)
- 2 (3-D)
- 3 (Bar)
- 4 (Cluster)
- 5 (Stack)
- 6 (Line)
- 7 (Multi-Line)
- 8 (Correlated)
- 9 (Scatter)
References to the position of an object in the collection are not valid after you use this method.
| Parameters |
Description |
|---|---|
| GraphType |
Required. Specifies the Graph object type to add. Type: Integer |
| Depth |
Optional. Specifies whether the Graph object is three-dimensional (3D). Applies only to graph types 1, 3, 4, and 5. Default: True (for Type 1, 3, 4 and 5) Type: Boolean |
| Vertical |
Optional. Specifies whether the Graph object is a vertical display. If the property is False, it applies only to graph type 3. Default: True Type: Boolean |
Return Type
Object
Example
This example adds a new display type to the active report. The display added is a horizontal, three-dimensional, bar graph.
Sub Main() Dim objPPRep As Object Dim objPPGraph As Object Dim objGraphs As Object Const type_bar = 3 Const three_d = True Const horizontal = False Set objPPRep = GetObject(, "CognosPowerPlay.Report") Set objGraphs = objPPRep.Graphs Set objPPGraph = objGraphs.Add _ (type_bar, three_d, horizontal) Set objPPGraph = Nothing Set objGraphs = Nothing Set objPPRep = Nothing End Sub