A demonstration of how you can combine the RGraph chart types on to a single SVG tag. Here a Bar chart is being combined with a filled Line chart - a common combination. Both charts are using the labelsAbove option. and they both too have a center X axis.
This goes in the documents header:<script src="RGraph.svg.common.core.js"></script> <script src="RGraph.svg.bar.js"></script> <script src="RGraph.svg.line.js"></script>, Put this where you want the chart to show up:
<div style="width: 650px; height: 300px" id="chart-container"></div>This is the code that generates the chart:
<script> new RGraph.SVG.Bar({ id: 'chart-container', data: [[-43,14],[57,-44],[-64,-16],[56,-36],[21,-89],[-39,-41],[-78,-10]], options: { yaxisTextSize: 10, yaxisLabelsCount: 10, yaxisScaleMin: -100, yaxisScaleMax: 100, hmargin: 10, colors: ['rgba(255,0,0,0.2)','rgba(0,200,200,0.2)'], marginLeft: 50, labelsAbove: true, labelsAboveSize: 8 } }).draw(); new RGraph.SVG.Line({ id: 'chart-container', data: [19,-88,71,66,93,-96,55], options: { spline: true, backgroundGrid: false, marginLeft: 50, yaxisScaleMax: 100, yaxisScaleMin: -100, yaxis:false, yaxisScale: false, xaxis: false, hmargin: 40, filled: true, filledColors: ['rgba(0,200,200,0.25)'], colors: ['#0bb'], linewidth: 3, tickmarksStyle: 'filledcircle', labelsAbove: true, labelsAboveSize: 8 } }).draw(); </script>