Share: Bookmark with delicious tweet this site Post to Facebook

RGraph: HTML5 canvas graph library - Thermometer chart documentation

The thermometer chart, along with the progress bar, is a prime candidate for use in a status panel. Much like the progress bar, but the design may be better suited to your application/website etc.

The example file is here.

 
<script>
    window.onload = function ()
    {
        var thermometer = new RGraph.Thermometer('myCanvas', data);
        thermometer.Set('chart.gutter', 45);
        thermometer.Set('chart.colors', ['rgba(255,0,0,1)']);
        thermometer.Draw();
    }
</script>

Properties

You can use these properties to control how the bar graph apears. You can set them by using the Set() method. Eg:

myBar.Set('name', 'value');

Chart configuration

chart.width
This controls the width of the graph. You can set this to (for example) 600 and have your canvas 650px wide giving an extra 50px for labels.
Default: null (By default the canvas width is used)

chart.height
This controls the height of the graph. You can set this to (for example) 250 and have your canvas 300px heigh giving an extra 50px for labels.
Default: null (By default the canvas height is used)

Colors

chart.colors
An array of the colors of the actual bars.
Default: An array - ['rgb(0,0,255)', '#0f0', '#00f', '#ff0', '#0ff', '#0f0']

Shadow

chart.shadow
Whether a drop shadow is applied.
Default: true

chart.shadow.color
The color of the shadow.
Default: gray

chart.shadow.offsetx
The X offset of the shadow.
Default: 0

chart.shadow.offsety
The Y offset of the shadow.
Default: 0

chart.shadow.blur
The severity of the shadow blurring effect.
Default: 15

Zoom

chart.zoom.mode
Can be used to control whether the zoom is in thumbnail or canvas mode. Possible values are: thumbnail and canvas.
Default: canvas

chart.zoom.factor
This is the factor that the graph will be zoomed by (bigger values means more zoom)
Default: 1.5

chart.zoom.fade.in
Whether the zoomed canvas fades in or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true

chart.zoom.fade.out
Whether the zoomed canvas fades out or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true

chart.zoom.hdir
The horizontal direction of the zoom. Possible values are: left, center, right
Default: right

chart.zoom.vdir
The vertical direction of the zoom. Possible values are: up, center, down
Default: down

chart.zoom.delay
The delay (in milliseconds) between frames.
Default: 50

chart.zoom.frames
The number of frames in the zoom animation.
Default: 10

chart.zoom.shadow
Whether or not the zoomed canvas has a shadow or not.
Default: true

chart.zoom.thumbnail.width
When the zoom is in thumbnail mode, this is the width (in pixels) of the thumbnail.
Default: 75

chart.zoom.thumbnail.height
When the zoom is in thumbnail mode, this is the height (in pixels) of the thumbnail.
Default: 75

chart.zoom.background
Defaulting to true, this determines whether the zoom has a dark, semi-opaque background that covers the entire web page.
Default: true