====== Dynamic Labels in Gauges ====== Using dynamic labels you can make your gauges change the appearance based on data values. Those can be changed either by user request or normal data. It is possible to replace image-bands by dynamic labels, without any performance loss.\\ The extended Tag looks as follows:\\ When displaying the label on the gauge, SPAD.neXt will evaluate the expression (''TextExpression'') and format its result according to the ''TextFormat''.\\ In the example the result will be evaluated as Truncate(FUELLEVEL * 10) / 10 , formatted as floating point number with one decimal ([[https://msdn.microsoft.com/EN-US/library/dwhawy9k(v=VS.110,d=hv.2).aspx|Standard numeric format strings]]) and written right-aligned (''HorizontalAlignment="Far"'') to the gauge using the LCDMono2-Font in a box (225,383,455,451). Everything that is not fitting into the box will be cut off. As Font every installed font on the system as well as those defined in the gauge (see [[gauges:gaugesettings_sample|SPAD.neXt GaugeSettings]]) can be used. If the font is not found __Tahoma__ will be used. Possible Alignment Settings: * "Near" = Left-/Top-aligned * "Center" = Center aligned * "Far" = Right-/Bottom-aligned ===== TextFormat ===== The value of the ''TextExpression'' will be used as Parameter 0 for the format string.\\ It is possible to use all standard formatting rules according to [[https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110,d=hv.2).aspx#Anchor_0|Composite Formatting]] ===== Dynamic Colors ===== The -Tag can be expaned to contain dynamic expressions for the color. If BackgroundValue/ForegroundValue tags are present the default values will be ignored and the given expressions will be evaluated. Expressions have to be in SPAD.neXt format (see custom expression) and will always be interpreted as a string. To reference Gauge/Profile/Device scoped variables in the expression you can use the prefixes GAUGE: PROFILE: DEVICE: Example: [GAUGE:MY_COOL_VARIABLE_NAME] [DEVICE:MY_EVEN_COOLER_VARIABLE_NAME] The expression can eiter return a [[https://docs.microsoft.com/en-us/dotnet/api/system.drawing.knowncolo|KnownColor]] or a hexadecimal value in form '#AARRGGBB' ([[https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32|ARGB32]])