void SetObsLabelVar( String sVarName )
String sVarName
The name of the variable in the associated DataObject whose values should be used as observation labels. If sVarName is null,
observations will be labeled by observation number.
This method specifies the name of the variable in the associated DataObject whose values should be used as observation labels. To turn on the display of the label variable's values, you must call Plot.ShowObsLabels.
Calls to this method are ignored by the BarChart, Histogram, or MosaicPlot classes because those plots do not display markers for individual observations.
Note that the label variable set by this method is distinct from the label variable set by the method DataObject.SetRoleVar. The method DataObject.SetRoleVar instructs all associated data views to use the specified label variable. The method Plot.SetObsLabelVar enables you to customize the label variable used by a specific plot.
x = 1:8; y = 1:8; years = "1990":"1997"; declare DataObject dobj; dobj = DataObject.Create( "Sample" ); dobj.AddVar( "X", x ); dobj.AddVar( "Y", y ); dobj.AddVar( "Year", years ); declare ScatterPlot plot; plot = ScatterPlot.Create( dobj, "X", "Y" ); plot.SetObsLabelVar( "Year" ); plot.ShowObsLabels();