SetUnit method (XY Plot object)

Sets the unit of a trace and shows the unit in the legend.
Syntax
XYPlot1
.
SetUnit
(
xTagName
,
yTagName
, [
xUnit
], [
yUnit
], [
xModelName
], [
yModelName
], [
xTraceType
], [
yTraceType
])
where
XYPlot1
- is the name of an XY Plot object or an expression that evaluates to an XY Plot object.
xTagName
- is a parameter of String that specifies the x tag of the trace.
yTagName
- is a parameter of String that specifies the y tag of the trace.
xUnit
- is a parameter of String that specifies the unit for the x-axis of the trace. The unit will display in the x-axis of the XY Plot and in the
X Unit
field of the Tag list.
yUnit
- is a parameter of String that specifies the unit for the y-axis of the trace. The unit will display in the y-axis of the XY Plot and in the
Y Unit
field of the Tag list. You can specify
xUnit
or
yUnit
, or both. You can also use extended tag property or tag value for the unit.
xModelName
- is an optional parameter of String that specifies the historical model name. The parameter is required if the
xTraceType
is
TraceTypeAF
,
TraceTypeDataLog
,
TraceTypeHistorian
, or
TraceTypePIServer
.
yModelName
- is an optional parameter of String that specifies the historical model name. The parameter is required if the
yTraceType
is
TraceTypeAF
,
TraceTypeDataLog
,
TraceTypeHistorian
, or
TraceTypePIServer
.
xTraceType
- is an optional parameter of the
XYTraceType
constant. The parameter can be omitted if the trace type is live data or data log.
yTraceType
- is an optional parameter of the
XYTraceType
constant. The parameter can be omitted if the trace type is live data or data log.
Example
Private Sub SetXYPlotUnit() 'Sets the unit for TagX and TagY from Live Data. XYPlot1.SetUnit "TagX", "TagY", "unit_TagX", "unit_TagY" End Sub
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal