A 2D Bar chart with an offset X axis

[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.bar.js"></script>
Put this where you want the chart to show up:
<div style="padding: 15px; display: inline-block">
    <canvas id="cvs" width="750" height="250">[No canvas support]</canvas>
This is the code that generates the chart:
    new RGraph.Bar({
        id: 'cvs',
        data: [7,8,34,-9,-6,20,18],
        options: {
            labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
            unitsPost: '%',
            shadow: false,
            colors: ['red'],
            strokestyle: 'rgba(0,0,0,0)',
            textSize: 14,
            textAccessible: true,
            title: 'A Bar chart with an offset X axis',
            numyticks: 6,
            gutterLeft: 50,
            scaleZerostart: true,
            ymin: -10,
            ymax: 50,
            backgroundGridVlines: false,
            backgroundGridAutofitNumhlines: 6,
            backgroundGridBorder: false,
            ylabelsCount: 6

Share on Facebook Share on Twitter

« Back