# HBar chart Grow effect changing values

This is a demo of the grow effect being passed new data and instead of growing from zero it grows from the old data to the new data supplied.

This goes in the documents header:

    <script src="RGraph.common.core.js"></script>
    <script src="RGraph.hbar.js"></script>

Put this where you want the chart to show up:

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

This is the code that generates the chart:

    <script>
        hbar = new RGraph.HBar({
            id: 'cvs',
            data: [86,485],
            options: {
                xmax: 500,
                noxaxis: true,
                backgroundGridHlines: false,
                backgroundGridBorder: false
            }
        }).grow();

        setTimeout(function ()
        {
            hbar.grow({data: [126,218]});
        }, 2500);
    </script>

« Back