dashboard.js
4.41 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
$( document ).ready(function() {
// CounterUp Plugin
$('.counter').counterUp({
delay: 10,
time: 1000
});
setTimeout(function() {
toastr.options = {
closeButton: true,
progressBar: true,
showMethod: 'fadeIn',
hideMethod: 'fadeOut',
timeOut: 5000
};
toastr.success('Checkout settings menu on left!', 'Welcome to Modern!');
}, 1800);
var flot2 = function () {
// We use an inline data source in the example, usually data would
// be fetched from a server
var data = [],
totalPoints = 100;
function getRandomData() {
if (data.length > 0)
data = data.slice(1);
// Do a random walk
while (data.length < totalPoints) {
var prev = data.length > 0 ? data[data.length - 1] : 50,
y = prev + Math.random() * 10 - 5;
if (y < 0) {
y = 0;
} else if (y > 100) {
y = 100;
}
data.push(y);
}
// Zip the generated y values with the x values
var res = [];
for (var i = 0; i < data.length; ++i) {
res.push([i, data[i]])
}
return res;
}
var plot2 = $.plot("#flotchart2", [ getRandomData() ], {
series: {
shadowSize: 0 // Drawing is faster without shadows
},
yaxis: {
min: 0,
max: 100
},
xaxis: {
show: false
},
colors: ["#22BAA0"],
legend: {
show: false
},
grid: {
color: "#AFAFAF",
hoverable: true,
borderWidth: 0,
backgroundColor: '#FFF'
},
tooltip: true,
tooltipOpts: {
content: "Y: %y",
defaultTheme: false
}
});
function update() {
plot2.setData([getRandomData()]);
plot2.draw();
setTimeout(update, 30);
}
update();
};
flot2();
var flot1 = function () {
var data = [[0, 65], [1, 59], [2, 80], [3, 81], [4, 56], [5, 55], [6, 40]];
var data2 = [[0, 28], [1, 48], [2, 40], [3, 19], [4, 86], [5, 27], [6, 90]];
var dataset = [
{
data: data,
color: "rgba(220,220,220,1)",
lines: {
show: true,
fill: 0.2,
},
shadowSize: 0,
}, {
data: data,
color: "#fff",
lines: {
show: false,
},
points: {
show: true,
fill: true,
radius: 4,
fillColor: "rgba(220,220,220,1)",
lineWidth: 2
},
curvedLines: {
apply: false,
},
shadowSize: 0
}, {
data: data2,
color: "rgba(34,186,160,1)",
lines: {
show: true,
fill: 0.2,
},
shadowSize: 0,
},{
data: data2,
color: "#fff",
lines: {
show: false,
},
curvedLines: {
apply: false,
},
points: {
show: true,
fill: true,
radius: 4,
fillColor: "rgba(34,186,160,1)",
lineWidth: 2
},
shadowSize: 0
}
];
var ticks = [[0, "1"], [1, "2"], [2, "3"], [3, "4"], [4, "5"], [5, "6"], [6, "7"], [7, "8"]];
var plot1 = $.plot("#flotchart1", dataset, {
series: {
color: "#14D1BD",
lines: {
show: true,
fill: 0.2
},
shadowSize: 0,
curvedLines: {
apply: true,
active: true
}
},
xaxis: {
ticks: ticks,
},
legend: {
show: false
},
grid: {
color: "#AFAFAF",
hoverable: true,
borderWidth: 0,
backgroundColor: '#FFF'
}
});
};
flot1();
$(".live-tile").liveTile();
});