# An SVG stacked Bar chart

This goes in the documents header:

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

Put this where you want the chart to show up:

    <div style="width: 950px; height: 300px" id="chart-container"></div>

This is the code that generates the chart:

    <script>
        new RGraph.SVG.Bar({
            id: 'chart-container',
            data: [[19.809672,2.309533,1.576628],[20.831782,1.638780,1.529451],[22.933183,2.340360,3.277996],[19.775762,3.369877,1.927770],[34.897281,3.093969,2.672899],[33.971873,2.319708, 4.064356]],
            options: {
                title: 'A magyarorszagi csomagforgalom alakulasa',
                titleSubtitle: 'Darabszamok a versenypiaci szolgaltatasban. Forras: NMHH',
                colors: ['#8EC3A7','#DC5356','#F0CB69'],
                xaxisLabels: ['2010','2011','2012','2013','2014','2015'],
                grouping: 'stacked',
                strokestyle: 'white',
                yaxisMax: 50,
                yaxisColor: 'transparent',
                yaxisUnitsPost: 'm',
                xaxisColor: 'transparent',
                textSize: 10,
                textColor: '#999',
                backgroundGridVlines: false,
                backgroundGridBorder: false,
                hmargin: 40,
                gutterTop: 50,
                gutterLeft: 50
            }
        }).grow();
    </script>

« Back