1
1
/* eslint-disable object-shorthand */
2
- /* global Chart, coreui, getStyle, hexToRgba */
2
+ /* global Chart, coreui, coreui.Utils. getStyle, coreui.Utils. hexToRgba */
3
3
4
4
/**
5
5
* --------------------------------------------------------------------------
6
- * CoreUI Free Boostrap Admin Template (v3.0.0-alpha.1 ): main.js
6
+ * CoreUI Boostrap Admin Template (v3.0.0): main.js
7
7
* Licensed under MIT (https://coreui.io/license)
8
8
* --------------------------------------------------------------------------
9
9
*/
@@ -21,12 +21,12 @@ Chart.defaults.global.responsiveAnimationDuration = 1
21
21
document . body . addEventListener ( 'classtoggle' , event => {
22
22
if ( event . detail . className === 'c-dark-theme' ) {
23
23
if ( document . body . classList . contains ( 'c-dark-theme' ) ) {
24
- cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--primary-dark-theme' )
25
- cardChart2 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--info-dark-theme' )
24
+ cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = coreui . Utils . getStyle ( '--primary-dark-theme' )
25
+ cardChart2 . data . datasets [ 0 ] . pointBackgroundColor = coreui . Utils . getStyle ( '--info-dark-theme' )
26
26
Chart . defaults . global . defaultFontColor = '#fff'
27
27
} else {
28
- cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--primary' )
29
- cardChart2 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--info' )
28
+ cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = coreui . Utils . getStyle ( '--primary' )
29
+ cardChart2 . data . datasets [ 0 ] . pointBackgroundColor = coreui . Utils . getStyle ( '--info' )
30
30
Chart . defaults . global . defaultFontColor = '#646470'
31
31
}
32
32
@@ -46,7 +46,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
46
46
label : 'My First dataset' ,
47
47
backgroundColor : 'transparent' ,
48
48
borderColor : 'rgba(255,255,255,.55)' ,
49
- pointBackgroundColor : getStyle ( '--primary' ) ,
49
+ pointBackgroundColor : coreui . Utils . getStyle ( '--primary' ) ,
50
50
data : [ 65 , 59 , 84 , 84 , 51 , 55 , 40 ]
51
51
}
52
52
]
@@ -99,7 +99,7 @@ const cardChart2 = new Chart(document.getElementById('card-chart2'), {
99
99
label : 'My First dataset' ,
100
100
backgroundColor : 'transparent' ,
101
101
borderColor : 'rgba(255,255,255,.55)' ,
102
- pointBackgroundColor : getStyle ( '--info' ) ,
102
+ pointBackgroundColor : coreui . Utils . getStyle ( '--info' ) ,
103
103
data : [ 1 , 18 , 9 , 17 , 34 , 22 , 11 ]
104
104
}
105
105
]
@@ -194,7 +194,7 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
194
194
backgroundColor : 'rgba(255,255,255,.2)' ,
195
195
borderColor : 'rgba(255,255,255,.55)' ,
196
196
data : [ 78 , 81 , 80 , 45 , 34 , 12 , 40 , 85 , 65 , 23 , 12 , 98 , 34 , 84 , 67 , 82 ] ,
197
- barPercentage : 0.7
197
+ barPercentage : 0.6
198
198
}
199
199
] ,
200
200
} ,
@@ -222,24 +222,24 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
222
222
datasets : [
223
223
{
224
224
label : 'My First dataset' ,
225
- backgroundColor : hexToRgba ( getStyle ( '--info' ) , 10 ) ,
226
- borderColor : getStyle ( '--info' ) ,
225
+ backgroundColor : coreui . Utils . hexToRgba ( coreui . Utils . getStyle ( '--info' ) , 10 ) ,
226
+ borderColor : coreui . Utils . getStyle ( '--info' ) ,
227
227
pointHoverBackgroundColor : '#fff' ,
228
228
borderWidth : 2 ,
229
229
data : [ 165 , 180 , 70 , 69 , 77 , 57 , 125 , 165 , 172 , 91 , 173 , 138 , 155 , 89 , 50 , 161 , 65 , 163 , 160 , 103 , 114 , 185 , 125 , 196 , 183 , 64 , 137 , 95 , 112 , 175 ]
230
230
} ,
231
231
{
232
232
label : 'My Second dataset' ,
233
233
backgroundColor : 'transparent' ,
234
- borderColor : getStyle ( '--success' ) ,
234
+ borderColor : coreui . Utils . getStyle ( '--success' ) ,
235
235
pointHoverBackgroundColor : '#fff' ,
236
236
borderWidth : 2 ,
237
237
data : [ 92 , 97 , 80 , 100 , 86 , 97 , 83 , 98 , 87 , 98 , 93 , 83 , 87 , 98 , 96 , 84 , 91 , 97 , 88 , 86 , 94 , 86 , 95 , 91 , 98 , 91 , 92 , 80 , 83 , 82 ]
238
238
} ,
239
239
{
240
240
label : 'My Third dataset' ,
241
241
backgroundColor : 'transparent' ,
242
- borderColor : getStyle ( '--danger' ) ,
242
+ borderColor : coreui . Utils . getStyle ( '--danger' ) ,
243
243
pointHoverBackgroundColor : '#fff' ,
244
244
borderWidth : 1 ,
245
245
borderDash : [ 8 , 5 ] ,
@@ -285,80 +285,3 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
285
285
}
286
286
}
287
287
} )
288
-
289
- const brandBoxChartLabels = [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ]
290
-
291
- const brandBoxChartOptions = {
292
- responsive : true ,
293
- maintainAspectRatio : false ,
294
- legend : {
295
- display : false
296
- } ,
297
- scales : {
298
- xAxes : [ {
299
- display :false
300
- } ] ,
301
- yAxes : [ {
302
- display :false
303
- } ]
304
- } ,
305
- elements : {
306
- point : {
307
- radius : 0 ,
308
- hitRadius : 10 ,
309
- hoverRadius : 4 ,
310
- hoverBorderWidth : 3
311
- }
312
- }
313
- }
314
-
315
- // eslint-disable-next-line no-unused-vars
316
- const brandBoxChart1 = new Chart ( document . getElementById ( 'social-box-chart-1' ) , {
317
- type : 'line' ,
318
- data : {
319
- labels : brandBoxChartLabels ,
320
- datasets : [ {
321
- label : 'My First dataset' ,
322
- backgroundColor : 'rgba(255,255,255,.1)' ,
323
- borderColor : 'rgba(255,255,255,.55)' ,
324
- pointHoverBackgroundColor : '#fff' ,
325
- borderWidth : 2 ,
326
- data : [ 65 , 59 , 84 , 84 , 51 , 55 , 40 ]
327
- } ]
328
- } ,
329
- options : brandBoxChartOptions
330
- } )
331
-
332
- // eslint-disable-next-line no-unused-vars
333
- const brandBoxChart2 = new Chart ( document . getElementById ( 'social-box-chart-2' ) , {
334
- type : 'line' ,
335
- data : {
336
- labels : brandBoxChartLabels ,
337
- datasets : [ {
338
- label : 'My First dataset' ,
339
- backgroundColor : 'rgba(255,255,255,.1)' ,
340
- borderColor : 'rgba(255,255,255,.55)' ,
341
- pointHoverBackgroundColor : '#fff' ,
342
- borderWidth : 2 ,
343
- data : [ 1 , 13 , 9 , 17 , 34 , 41 , 38 ]
344
- } ]
345
- } ,
346
- options : brandBoxChartOptions
347
- } )
348
-
349
- // eslint-disable-next-line no-unused-vars
350
- const brandBoxChart3 = new Chart ( document . getElementById ( 'social-box-chart-3' ) , {
351
- type : 'line' ,
352
- data : {
353
- labels : brandBoxChartLabels ,
354
- datasets : [ {
355
- label : 'My First dataset' ,
356
- backgroundColor : 'rgba(255,255,255,.1)' ,
357
- borderColor : 'rgba(255,255,255,.55)' ,
358
- pointHoverBackgroundColor : '#fff' ,
359
- borderWidth : 2 ,
360
- data : [ 78 , 81 , 80 , 45 , 34 , 12 , 40 ]
361
- } ]
362
- } ,
363
- options : brandBoxChartOptions
364
- } )
0 commit comments