A demonstration of using the Bar chart with errorbars
. These work with regular, grouped and stacked data, positive or negative.
<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="padding: 15px"> <div style="width: 750px; height: 300px" id="chart-container"></div> </div>This is the code that generates the chart:
<script> bar = new RGraph.SVG.Bar({ id: 'chart-container', data: [[4,8,6],[5,3,6],0,[-5,-6,-4],[-5,-6,-4]], options: { errorbars: [ {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1}, {min:1, max:1} ], errorbarsColor: 'black', errorbarsLinewidth: 1, colors: ['Gradient(red:#c00)','Gradient(#0f0:#c00)','Gradient(#00f:#ccc)'], marginInner: 20, xaxisLabels: ['Harry','Pete','Lucy','Paul'], yaxis: false, yaxisScaleMin: 'mirror', backgroundGridVlines: false, backgroundGridBorder: false, shadow: true } }).grow(); </script>