-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw.js
34 lines (29 loc) · 1.11 KB
/
draw.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart','line']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Number');
data.addColumn('number', 'Participants');
data.addRows([
['2015',250],
['2016', 400],
['2017', 750],
['2018', 1000],
]);
// Set chart options
var options = {'title':'How Many People Participated In Cryptex Over the years',
'width':700,
'height':400,
'backgroundColor':"black",
'animation.duration':10000
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}