Created
May 8, 2010 15:03
-
-
Save ryopeko/394600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
google.load("visualization", "1", {packages:["linechart"]}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart(){ | |
var data = new google.visualization.DataTable(); | |
data.addColumn('string', 'days'); | |
data.addColumn('number', 'キャベツ'); | |
data.addColumn('number', 'にんじん'); | |
data.addRows(6); | |
data.setValue(0, 0, "2010/4/20"); | |
data.setValue(0, 1, 350); | |
data.setValue(0, 2, 80); | |
data.setValue(1, 0, "2010/4/21"); | |
data.setValue(1, 1, 320); | |
data.setValue(1, 2, 78); | |
data.setValue(2, 0, "2010/4/22"); | |
data.setValue(2, 1, 310); | |
data.setValue(2, 2, 76); | |
data.setValue(3, 0, "2010/4/23"); | |
data.setValue(3, 1, 280); | |
data.setValue(3, 2, 78); | |
data.setValue(4, 0, "2010/4/24"); | |
data.setValue(4, 1, 290); | |
data.setValue(4, 2, 78); | |
data.setValue(5, 0, "2010/4/25"); | |
data.setValue(5, 1, 288); | |
data.setValue(5, 2, 79); | |
var chart = new google.visualization.LineChart(document.getElementById('chartDiv')); | |
options = { | |
width: 600, | |
height: 350, | |
legend: 'bottom', | |
title: '野菜のお値段' | |
}; | |
chart.draw(data, options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment