Demos

Beginner's Guide

Charts / Gauges / Maps Guide

Customizing Charts

API

Integrating With Your Stack

Help

Loading

A thermometer gauge is used to display temperature data; the fill level of the thermometer indicates the temperature.

In this section, you will be shown how you can create a simple thermometer gauge.

Creating a Simple Thermometer Gauge

For our example, we will create a thermometer gauge that monitors the temperature at the Central Cold Store.

To create a thermometer gauge, you need to:

  • Define the lower and upper limits (also known as the starting and ending values) that can be plotted on the gauge. For our example, we will set the lower limit to -20 and the upper limit to 20.

  • Define the temperature value to be displayed by the gauge. This value is displayed on the gauge by filling up the thermometer to this mark on the gauge scale. For our example, we will set this value to -6°C.

A thermometer gauge created to monitor the temperature at the Central Cold Store looks like this:

FusionCharts will load here..

Given below is a brief description of the attributes used to create a simple thermometer gauge:

Attribute Name Description

lowerLimit

It is used to specify the lower limit, or the minimum value, of the gauge scale, eg. 0.

upperLimit

It is used to specify the upper limit, or the maximum value, of the gauge scale, eg. 100.

numberSuffix

It is used to specify the character which will be appended to the end of the number, eg. °C.

thmFillColor

It is used to specify the hex code of the color that will be used as the fill color for the thermometer, e.g #666666.

thmOriginX

It is used to specify the horizontal origin for the thermometer gauge (you can define this as the starting coordinate on an imaginary x-axis), e.g. 100.

The data structure needed to create a simple thermometer gauge is given below:

{ "chart": { "caption": "Temperature Monitor", "subcaption": " Central cold store", "lowerLimit": "-10", "upperLimit": "0", "decimals": "1", "numberSuffix": "°C", "showhovereffect": "1", "thmFillColor": "#008ee4", "showGaugeBorder": "1", "gaugeBorderColor": "#008ee4", "gaugeBorderThickness": "2", "gaugeBorderAlpha": "30", "thmOriginX": "100", "chartBottomMargin": "20", "valueFontColor": "#000000", "theme": "fint" }, "value": "-6", "annotations": { "showbelow": "0", "groups": [ { "id": "indicator", "items": [ { "id": "background", "type": "rectangle", "alpha": "50", "fillColor": "#AABBCC", "x": "$gaugeEndX-40", "tox": "$gaugeEndX", "y": "$gaugeEndY+54", "toy": "$gaugeEndY+72" } ] } ] } }
{
    "chart": {
        "caption": "Temperature Monitor",
        "subcaption": " Central cold store",
        "lowerLimit": "-10",
        "upperLimit": "0",
        "decimals": "1",
        "numberSuffix": "°C",
        "showhovereffect": "1",
        "thmFillColor": "#008ee4",
        "showGaugeBorder": "1",
        "gaugeBorderColor": "#008ee4",
        "gaugeBorderThickness": "2",
        "gaugeBorderAlpha": "30",
        "thmOriginX": "100",
        "chartBottomMargin": "20",
        "valueFontColor": "#000000",
        "theme": "fint"
    },
    "value": "-6",
    "annotations": {
        "showbelow": "0",
        "groups": [
            {
                "id": "indicator",
                "items": [
                    {
                        "id": "background",
                        "type": "rectangle",
                        "alpha": "50",
                        "fillColor": "#AABBCC",
                        "x": "$gaugeEndX-40",
                        "tox": "$gaugeEndX",
                        "y": "$gaugeEndY+54",
                        "toy": "$gaugeEndY+72"
                    }
                ]
            }
        ]
    }
}

There! You have now seen how you can create a simple thermometer gauge.

Top