Click or drag to resize
Grid Solutions Framework

LabelT Class

Renames a series with the specified label value. If multiple series are targeted, labels will be indexed starting at one, e.g., if there are three series in the target expression with a label value of "Max", series would be labeled as "Max 1", "Max 2" and "Max 3". Group operations on this function will be ignored. Label valueparameter can be optionally quoted with single or double quotes.

The label parameter also supports substitutions when root target metadata can be resolved. For series values that directly map to a point tag, metadata value substitutions for the tag can be used in the label value - for example: {Alias}, {ID}, {SignalID}, {PointTag}, {AlternateTag}, {SignalReference}, {Device}, {FramesPerSecond}, {Protocol}, {ProtocolType}, {SignalType}, {EngineeringUnits}, {PhasorType}, {PhasorLabel}, {BaseKV}, {Company}, {Longitude}, {Latitude}, {Description}, etc. Each of these fields come from the "ActiveMeasurements" metadata source, as defined in the "ConfigurationEntity" table. Where applicable, substitutions can be used along with fixed label text in any combination, e.g.: 'Series {ID} [{PointTag}]'.

Other metadata sources that target time-series measurements can also be used for substitutions so long the source is defined in the "ConfigurationEntity" table and the metadata columns include a "PointTag" field that can be matched to the target Grafana series name. To use any field from another defined metadata source, use the following substitution parameter format: {TableName.FieldName}.
Inheritance Hierarchy

Namespace: GrafanaAdapters.Functions.BuiltIn
Assembly: GrafanaAdapters (in GrafanaAdapters.dll) Version: 2.4.181-beta
Syntax
public abstract class Label<T> : GrafanaFunctionBase<T>
where T : struct, new(), IDataSourceValueType<T>
View Source

Type Parameters

T

The LabelT type exposes the following members.

Constructors
 NameDescription
Protected methodLabelTInitializes a new instance of the LabelT class
Top
Properties
 NameDescription
Public propertyAliases Gets any defined aliases for the Grafana function.
(Overrides GrafanaFunctionBaseTAliases)
Public propertyAllowedGroupOperations Gets set of group operations that the Grafana function allows.
(Overrides GrafanaFunctionBaseTAllowedGroupOperations)
Public propertyCategory Gets the category of the Grafana function, i.e., built-in or custom.
(Inherited from GrafanaFunctionBaseT)
Public propertyDataTypeIndex Gets the data source value type index associated with the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public propertyDescription Gets the description of the Grafana function.
(Overrides GrafanaFunctionBaseTDescription)
Public propertyInternalParameterCount Gets the number of internal parameters of the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public propertyIsSliceSeriesEquivalent Gets or sets a flag indicating whether the function behaves equivalently when processed as a series or as a slice. Value defaults to true for functions that return a series of values, i.e., the return type is Series, and the AllowedGroupOperations includes the flag for Slice operations; otherwise, value defaults to false when the return type is a scalar value, i.e., Scalar, or the AllowedGroupOperations does not include the flag for Slice operations.
(Inherited from GrafanaFunctionBaseT)
Public propertyName Gets the name of the Grafana function.
(Overrides GrafanaFunctionBaseTName)
Public propertyOptionalParameterCount Gets the number of optional parameters of the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public propertyParameterDefinitions Gets the list of defined parameter definitions for the Grafana function.
(Overrides GrafanaFunctionBaseTParameterDefinitions)
Public propertyPublishedGroupOperations Gets set of group operations that the Grafana function exposes publicly.
(Overrides GrafanaFunctionBaseTPublishedGroupOperations)
Public propertyRequiredParameterCount Gets the number of required parameters, not including data source values expression, of the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public propertyResultIsSetTargetSeries Gets flag that determines if function result is target series for set-based group operations.
(Inherited from GrafanaFunctionBaseT)
Public propertyReturnType Gets the return type of the Grafana function, i.e., scalar or series.
(Overrides GrafanaFunctionBaseTReturnType)
Top
Methods
 NameDescription
Public methodCheckAllowedGroupOperation Checks if function allows requested group operation against AllowedGroupOperations property.
(Overrides GrafanaFunctionBaseTCheckAllowedGroupOperation(GroupOperations))
Public methodComputeAsync Executes the computation for the Grafana function.
(Overrides GrafanaFunctionBaseTComputeAsync(Parameters, CancellationToken))
Public methodComputeSetAsync Executes a custom set computation for the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public methodComputeSliceAsync Executes a custom slice computation for the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodExecuteFunction Executes specified function against data source values enumeration using provided parameters.
(Inherited from GrafanaFunctionBaseT)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodFormatTargetName Gets a formatted target name for the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Protected methodGetDataSourceValues Gets data source values enumeration found in the provided parameters.
(Inherited from GrafanaFunctionBaseT)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodParseParameters Executes custom parameter parsing for the Grafana function.
(Inherited from GrafanaFunctionBaseT)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks
Signature: Label(value, expression)
Returns: Series of values.
Example 1: Label('AvgFreq', SetAvg(FILTER TOP 20 ActiveMeasurements WHERE SignalType='FREQ')) Example 2: Label("{Alias} {EngineeringUnits}", Shelby=GPA_SHELBY:FREQ) Example 3: Label({AlternateTag}, FILTER TOP 10 ActiveMeasurements WHERE SignalType LIKE '%PH%') Example 4: Label('Shelby {ScadaTags.CircuitName} MW', FILTER ScadaTags WHERE SignalType='MW' AND Substation='SHELBY') Variants: Label, Name
Execution: Deferred enumeration.
See Also