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 id="yearFleetMixChart" class="googleChart"></div>

JavaScript

function drawChart() {
    // Create and populate the data table.				
    var yearData = google.visualization.arrayToDataTable([
        [ 'Departure Mix by Fleet Type', 'Heavy', 'Large', 'Medium', { role: 'annotation' } ],
					['2013'
							, 1.800000 , 79.700000 , 18.500000 , '']
						,['2014'
							, 1.700000 , 79.400000 , 18.900000 , '']

    ]);

    var yearOptions = { 
        backgroundColor: 'transparent',
        width: 650,
        height: 500,
        title: '',
        vAxis: {
            minValue: 0,
            title: 'Percent' ,
            titleTextStyle: {
                italic: false
            }
        },
        hAxis: {
            title: 'Fiscal Years',
            titleTextStyle: {
                italic: false
            }
        },
        bar: {
            groupWidth: 150
        },
        colors:['#8ab953','#0d8fe0','#003e8b'],
        isStacked: true						
    };

    var formatter = new google.visualization.NumberFormat(
        {
            pattern: '######,######,######.####'
        }
    );

    // Create and draw the chart.
    var yearChart = new  google.visualization.ColumnChart(document.getElementById('yearFleetMixChart'));
    formatter.format(yearData, 1);
    yearChart.draw(yearData, yearOptions);
    
}

google.load("visualization", "1", {
    packages: ["corechart"]
});
google.setOnLoadCallback(drawChart);