A gauge is a widget that displays the current value of a data metric. Gauges can include a scale on which the current value is marked. They also can include a text readout of the current value. As with all objects in DGLux5, you can use bindings to ensure that the properties of a gauge will change depending on the current data. DGLux5 includes pre-made gauges, and you can also design your own.
For a detailed reference of properties that affect gauges, see Common Properties and Gauge Scale Properties.
To use a pre-made DGLux5 gauge widget, you must have the Dashboard
widget library installed. A normal DGLux5 installation includes this library.
To use a pre-made gauge:
Dashboard
widget library into your project, by following the steps in Import a Widget Library.Find the gauge you want, and drag it to the Document window.
This inserts the gauge widget in your file.
Property Name | Importance, When Available | Steps |
---|---|---|
Value or Status | Crucial | Bind a data metric to this property using the steps in Bind from a Data Metric. Alternatively, you can bind a data value that has been loaded by a Data Services block in the dataflow. |
On | Crucial | Bind the same data metric to On that you bound to Value or Status. Value holds the string value for text readouts, and On holds the boolean value for determining other properties, such as color. |
Units | Important | Enter the units, such as "kW," "cfm," or "acres." |
Min and Max, or Min_Range and Max_Range | Important | Edit the lowest and highest values for the gauge scale. |
Title | Important | Enter a title for the gauge, such as "Airflow." |
Target | Optional | Enter the target value for this metric. If the target value changes based on other factors, you can use the dataflow to define a dynamic target value, and bind the result to Target. |
Various color properties | Optional | Choose the colors for the appropriate gauge pieces and conditions. |
Start Angle, End Angle | Optional | Edit the positions on the circle where you want the gauge scales to start and end. |
These steps create a basic, data-driven gauge widget with a track scale, label scale, and text readout. First, you style the appearance of the gauge. Next, you configure the gauge's behavior in reaction to data. Finally, you tie live data to the gauge.
If you want to create a gauge based on a mockup:
If your mockup does not include color codes, use a color picker browser plugin to match colors. You can paste the hex values into the DGLux5 fill and stroke pop-ups.
To style the gauge appearance:
Set Track Fill to the fill that you want.
To create some behavior for this gauge:
Bind the minimum and maximum symbol parameters to the Minimum and Maximum Scale Labels properties.
To tie data to this gauge:
In the Property Inspector, open the Symbol properties.
In the Data Panel, navigate to the data source.
In the Metrics panel, find the data metric.
In the Binding dialog, specify Value, and click OK.
If you want to save a gauge as a widget so that you can use it in other projects, follow the steps in Create Your Own Widget Library.
This thread in the DGLogik Community Forum addresses gauges: