1
- /* eslint-disable object-curly-newline */
2
1
/* global Chart */
3
2
4
3
/**
8
7
* --------------------------------------------------------------------------
9
8
*/
10
9
11
- /* eslint-disable no-magic-numbers */
12
10
// random Numbers
13
11
const random = ( ) => Math . round ( Math . random ( ) * 100 )
14
12
15
13
// eslint-disable-next-line no-unused-vars
16
14
const lineChart = new Chart ( document . getElementById ( 'canvas-1' ) , {
17
15
type : 'line' ,
18
16
data : {
19
- labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
20
- datasets : [
17
+ labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
18
+ datasets : [
21
19
{
22
20
label : 'My First dataset' ,
23
- backgroundColor : 'rgba(220, 220, 220, 0.2)' ,
24
- borderColor : 'rgba(220, 220, 220, 1)' ,
25
- pointBackgroundColor : 'rgba(220, 220, 220, 1)' ,
26
- pointBorderColor : '#fff' ,
27
- data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
21
+ backgroundColor : 'rgba(220, 220, 220, 0.2)' ,
22
+ borderColor : 'rgba(220, 220, 220, 1)' ,
23
+ pointBackgroundColor : 'rgba(220, 220, 220, 1)' ,
24
+ pointBorderColor : '#fff' ,
25
+ data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
28
26
} ,
29
27
{
30
28
label : 'My Second dataset' ,
31
- backgroundColor : 'rgba(151, 187, 205, 0.2)' ,
32
- borderColor : 'rgba(151, 187, 205, 1)' ,
33
- pointBackgroundColor : 'rgba(151, 187, 205, 1)' ,
34
- pointBorderColor : '#fff' ,
35
- data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
29
+ backgroundColor : 'rgba(151, 187, 205, 0.2)' ,
30
+ borderColor : 'rgba(151, 187, 205, 1)' ,
31
+ pointBackgroundColor : 'rgba(151, 187, 205, 1)' ,
32
+ pointBorderColor : '#fff' ,
33
+ data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
36
34
}
37
35
]
38
36
} ,
@@ -45,21 +43,21 @@ const lineChart = new Chart(document.getElementById('canvas-1'), {
45
43
const barChart = new Chart ( document . getElementById ( 'canvas-2' ) , {
46
44
type : 'bar' ,
47
45
data : {
48
- labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
49
- datasets : [
46
+ labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
47
+ datasets : [
50
48
{
51
- backgroundColor : 'rgba(220, 220, 220, 0.5)' ,
52
- borderColor : 'rgba(220, 220, 220, 0.8)' ,
49
+ backgroundColor : 'rgba(220, 220, 220, 0.5)' ,
50
+ borderColor : 'rgba(220, 220, 220, 0.8)' ,
53
51
highlightFill : 'rgba(220, 220, 220, 0.75)' ,
54
52
highlightStroke : 'rgba(220, 220, 220, 1)' ,
55
- data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
53
+ data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
56
54
} ,
57
55
{
58
- backgroundColor : 'rgba(151, 187, 205, 0.5)' ,
59
- borderColor : 'rgba(151, 187, 205, 0.8)' ,
60
- highlightFill : 'rgba(151, 187, 205, 0.75)' ,
61
- highlightStroke : 'rgba(151, 187, 205, 1)' ,
62
- data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
56
+ backgroundColor : 'rgba(151, 187, 205, 0.5)' ,
57
+ borderColor : 'rgba(151, 187, 205, 0.8)' ,
58
+ highlightFill : 'rgba(151, 187, 205, 0.75)' ,
59
+ highlightStroke : 'rgba(151, 187, 205, 1)' ,
60
+ data : [ random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) , random ( ) ]
63
61
}
64
62
]
65
63
} ,
0 commit comments