An SVG Bar chart using gradients
This goes in the documents header:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="RGraph.svg.common.core.js"></script>
<script src="RGraph.svg.common.tooltips.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>
new RGraph.SVG.Bar({
id: 'chart-container',
data: [4,8,6,3,5,2,4],
options: {
hmargin: 20,
xaxisLabels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
tooltips: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
title: 'A Bar chart with a gradient',
colors: ['Gradient(#f00:#fcc)'],
yaxis: false,
backgroundGridVlines: false,
backgroundGridBorder: false
}
}).grow();
</script>
« Back