StatsLineCaption Property
Syntax
object.StatsLineCaption(LineNumber)
Applies To
Discussion
Many graphs can be enhanced by the addition of statistical lines, such as a mean or average line superimposed on a bar graph of sales figures. Up to three lines can be added, as determined by the StatsLineOn property. Each statistical line is explained in an automatically generated legend. StatsLineCaption sets the line's label in the legend.
If not set, the caption defaults to the line type, such as "Maximum."
The applicable graph types are simple bar, clustered bar, correlation, simple line, multiple line, and scatter.
Parameters |
Description |
---|---|
LineNumber |
Required. Specifies which statistical line to reference: 1 = the minimum line (default caption: Minimum) 2 = the maximum line (default caption: Maximum) 3 = the mean or average line (default caption: Mean) 4 = the standard deviation line (default caption: Standard Deviation) 5 = the regression line (default caption: Regression) 6 = the first user-created line (default caption: Custom 1) 7 = the second user-created line (default caption: Custom 2) Type: Short |
Type
String
Access
Read/Write
Example
This example sets the first Graph object to the clustered bar type and displays a custom statistical line. The custom line is referred to as the Limit, and it is set to 100,000.
Sub Main()
Dim objPPRep As Object
Dim objPPGraph As Object
Set objPPRep = GetObject(, "CognosPowerPlay.Report")
Set objPPGraph = objPPRep.Graphs.Item(1)
With objPPGraph
.SetType 4,1,1
.StatsLineOn 6,True 'custom line
.StatsLineColor 6,2 'green
.StatsLineStyle 6,1 'dashed style
.StatsLineUserValue 6,100000
.StatsLineCaption 6,"Limit"
End With
Set objPPGraph = Nothing
Set objPPRep = Nothing
End Sub