Google Chart API - Answer
Your client, DataSet Corp, has asked for an interactive web based chart showing the change in revenue from 2005 until now. They would also like the overall average revenue to be reflected in the chart. Be sure to add a title, label axes, and reflect the red and black color scheme used by DSC.
by cs3vigny
HTML
<script src="http://www.google.com/jsapi?ext.js"></script>
<div class="chartWrapper" height="170" width="780">
<div id="chart" class="googleChart"></div>
</div>
CSS
.chartWrapper {
width: 780px;
height: 170px;
background: #fff url('http://dev-www.faa.gov/nextgen/snapshots/assets/img/demo/cityPairsGraphBackground.png') no-repeat;
padding-top: 50px;
overflow: hidden;
}
.googleChart {
margin-top: 60px;
margin-left: 140px;
}
JavaScript
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Revenue');
data.addRows([
['2009', 142],
['2010', 138],
['2011', 139],
['2012', 135]
]);
var options = {
width: 490,
height: 55,
title: '',
backgroundColor: 'transparent',
legend: {position: 'none'},
vAxis: {
textPosition: 'none',
gridlines: {
color: 'transparent'
},
baselineColor: 'transparent',
},
hAxis: {
textPosition: 'none'
},
colors: ['#0e8fe0'],
pointSize: 8
};
var chart = new google.visualization.LineChart(document.getElementById('chart'));
chart.draw(data, options);
}
google.load("visualization", "1", {
packages: ["corechart"]
});
google.setOnLoadCallback(drawChart);