-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialize.js
32 lines (31 loc) · 891 Bytes
/
initialize.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
var addNewChart = function(label) {
var chartOptions = {
type: 'bar',
data: {
labels: [],
datasets: [{
label: label,
data: [],
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}],
xAxes: [{
ticks: {
autoSkip: false,
callback: function(value, index, values) {
return new moment(value).format('MMM D, hA');
}
}
}]
}
}
};
return new Chart(document.getElementById("busChart").getContext('2d'), chartOptions);
}
var busChart = addNewChart("Number Of Buses Running");