// http://www.howtocreate.co.uk/tutorials/jsexamples/JSTidy.html

google.load("visualization", "1", {packages: ["linechart", "barchart", "columnchart"]});
var fig2_18;

function drawVisualization() {
    var fig2_18 = new (google.visualization.DataTable);
    fig2_18.addColumn("string", "Year");
    fig2_18.addColumn("number", "UK");
    fig2_18.addRows(18);
    fig2_18.setCell(0, 0, "1991");
    fig2_18.setCell(0, 1, 62455);
    fig2_18.setCell(1, 0, "1992");
    fig2_18.setCell(1, 1, 61366);
    fig2_18.setCell(2, 0, "1993");
    fig2_18.setCell(2, 1, 62333);
    fig2_18.setCell(3, 0, "1994");
    fig2_18.setCell(3, 1, 64787);
    fig2_18.setCell(4, 0, "1995");
    fig2_18.setCell(4, 1, 65644);
    fig2_18.setCell(5, 0, "1996");
    fig2_18.setCell(5, 1, 70626);
    fig2_18.setCell(6, 0, "1997");
    fig2_18.setCell(6, 1, 76103);
    fig2_18.setCell(7, 0, "1998");
    fig2_18.setCell(7, 1, 81774);
    fig2_18.setCell(8, 0, "1999");
    fig2_18.setCell(8, 1, 92521);
    fig2_18.setCell(9, 0, "2000");
    fig2_18.setCell(9, 1, 101550);
    fig2_18.setCell(10, 0, "2001");
    fig2_18.setCell(10, 1, 112835);
    fig2_18.setCell(11, 0, "2002");
    fig2_18.setCell(11, 1, 128265);
    fig2_18.setCell(12, 0, "2003");
    fig2_18.setCell(12, 1, 155627);
    fig2_18.setCell(13, 0, "2004");
    fig2_18.setCell(13, 1, 180248);
    fig2_18.setCell(14, 0, "2005");
    fig2_18.setCell(14, 1, 190760);
    fig2_18.setCell(15, 0, "2006");
    fig2_18.setCell(15, 1, 204813);
    fig2_18.setCell(16, 0, "2007");
    fig2_18.setCell(16, 1, 223405);
	
    (new (google.visualization.LineChart)(document.getElementById("figure2_18"))).draw(fig2_18, {width: 500, height: 300, legend: "none", titleY: "UK Pounds", min: "0"});
    drawToolbar2_18();

    function drawToolbar2_18() {
        var components = [{type: "csv", datasource: "http://spreadsheets.google.com/ccc?key=0AkMjzin45BHwdHVnQkVtbkFkSmdjcENHN3dqRnk2Mnc&sheet=Fig2_18"}, {type: "igoogle", datasource: "http://spreadsheets.google.com/ccc?key=0AkMjzin45BHwdHVnQkVtbkFkSmdjcENHN3dqRnk2Mnc&sheet=Fig2_18", gadget: "http://www.google.com/ig/modules/pie-chart.xml", userprefs: {'3d': 1}}, {type: "html", datasource: "http://spreadsheets.google.com/ccc?key=0AkMjzin45BHwdHVnQkVtbkFkSmdjcENHN3dqRnk2Mnc&sheet=Fig2_18"}, {type: "htmlcode", datasource: "http://spreadsheets.google.com/ccc?key=0AkMjzin45BHwdHVnQkVtbkFkSmdjcENHN3dqRnk2Mnc&sheet=Fig2_18", gadget: "http://www.google.com/ig/modules/pie-chart.xml", userprefs: {'3d': 1}, style: "width: 800px; height: 700px; border: 3px solid purple;"}];
        var container = document.getElementById("toolbar_2_18");
        google.visualization.drawToolbar(container, components);
    }

}

google.setOnLoadCallback(drawVisualization);
