# A Bar chart with a 3D effect and xaxispos=center

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:

    <canvas id="cvs" width="600" height="300">
        [No canvas support]
    </canvas>

This is the code that generates the chart:

    <script>
        window.onload = function ()
        {
            var bar = new RGraph.Bar({
                id: 'cvs',
                data: [[10,1,5],[1,-4,-2],[-2,-6,-8],[1,2,3]],
                options: {
                    textAccessible: true,
                    variant: '3d',
                    strokestyle: 'rgba(0,0,0,0)',
                    colors: [
                        'gradient(#0f0:#cfc:#0f0)',
                        'Gradient(red:#fcc:red)',
                        'Gradient(blue:#ccf:blue)'],
                    labels: ['Amy','Barry','Carl','Dave'],
                    xaxispos: 'center',
                    shadow: true,
                    shadowBlur: 25,
                    shadowOffsetx: 5,
                    shadowOffsety: -3,
                    shadowColor: '#ccc',
                    hmargin: 15,
                    hmarginGrouped: 1,
                    gutterLeft: 45,
                    gutterBottom: 75,
                    axisColor: '#aaa',
                    numxticks: 0,
                    numyticks: 0,
                    backgroundGridAutofitNumhlines: 4,
                    backgroundGridAutofitNumvlines: 4,
                    backgroundGridAutofitAlign: false,
                    ylabelsCount: 2,
                    scaleZerostart: true,
                    unitsPost: '%'
                }
            }).draw();
        };
    </script>

« Back