sparkline-custom.js
2.16 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
/**
* Created by roman on 6/30/2016.
*/
$(document).ready(function() {
var sparklineCharts = function(){
$("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52], {
type: 'line',
width: '100%',
height: '50',
lineColor: '#1ab394',
fillColor: "transparent"
});
$("#sparkline2").sparkline([32, 11, 25, 37, 41, 32, 34, 42], {
type: 'line',
width: '100%',
height: '50',
lineColor: '#1ab394',
fillColor: "transparent"
});
$("#sparkline3").sparkline([34, 22, 24, 41, 10, 18, 16,8], {
type: 'line',
width: '100%',
height: '50',
lineColor: '#1C84C6',
fillColor: "transparent"
});
};
var sparkResize;
$(window).resize(function(e) {
clearTimeout(sparkResize);
sparkResize = setTimeout(sparklineCharts, 500);
});
sparklineCharts();
var data1 = [
[0,4],[1,8],[2,5],[3,10],[4,4],[5,16],[6,5],[7,11],[8,6],[9,11],[10,20],[11,10],[12,13],[13,4],[14,7],[15,8],[16,12]
];
var data2 = [
[0,0],[1,2],[2,7],[3,4],[4,11],[5,4],[6,2],[7,5],[8,11],[9,5],[10,4],[11,1],[12,5],[13,2],[14,5],[15,2],[16,0]
];
$("#flot-dashboard5-chart").length && $.plot($("#flot-dashboard5-chart"), [
data1, data2
],
{
series: {
lines: {
show: false,
fill: true
},
splines: {
show: true,
tension: 0.4,
lineWidth: 1,
fill: 0.4
},
points: {
radius: 0,
show: true
},
shadowSize: 2
},
grid: {
hoverable: true,
clickable: true,
borderWidth: 2,
color: 'transparent'
},
colors: ["#1ab394", "#1C84C6"],
xaxis:{
},
yaxis: {
},
tooltip: false
}
);
});