A dual-scale Thermometer chart

[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.drawing.yaxis.js"></script>
<script src="RGraph.bar.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="100" height="400">
    [No canvas support]
This is the code that generates the chart:
    window.onload = function ()
        var thermometer = new RGraph.Thermometer({
            id: 'cvs',
            min: 0,
            max: 20,
            value: 8,
            options: {
                scaleVisible: true,
                gutterLeft: 25,
                textAccessible: true
        var coords = thermometer.coords;
        var yaxis = new RGraph.Drawing.YAxis({
            id: 'cvs',
            x: coords[0][0],
            options: {
                gutterTop: thermometer.bulbTopCenterY,
                gutterBottom: thermometer.canvas.height - (coords[0][1] + coords[0][3]),
                noyaxis: true,
                textColor: 'red',
                max: 100,
                min: 80,
                textAccessible: true

Share on Facebook Share on Twitter

« Back