11/* eslint-disable object-shorthand */
2- /* global Chart, coreui, getStyle, hexToRgba */
2+ /* global Chart, coreui, coreui.Utils. getStyle, coreui.Utils. hexToRgba */
33
44/**
55 * --------------------------------------------------------------------------
6- * CoreUI Free Boostrap Admin Template (v3.0.0-alpha.1 ): main.js
6+ * CoreUI Boostrap Admin Template (v3.0.0): main.js
77 * Licensed under MIT (https://coreui.io/license)
88 * --------------------------------------------------------------------------
99 */
@@ -21,12 +21,12 @@ Chart.defaults.global.responsiveAnimationDuration = 1
2121document . body . addEventListener ( 'classtoggle' , event => {
2222 if ( event . detail . className === 'c-dark-theme' ) {
2323 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' )
2626 Chart . defaults . global . defaultFontColor = '#fff'
2727 } 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' )
3030 Chart . defaults . global . defaultFontColor = '#646470'
3131 }
3232
@@ -46,7 +46,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
4646 label : 'My First dataset' ,
4747 backgroundColor : 'transparent' ,
4848 borderColor : 'rgba(255,255,255,.55)' ,
49- pointBackgroundColor : getStyle ( '--primary' ) ,
49+ pointBackgroundColor : coreui . Utils . getStyle ( '--primary' ) ,
5050 data : [ 65 , 59 , 84 , 84 , 51 , 55 , 40 ]
5151 }
5252 ]
@@ -99,7 +99,7 @@ const cardChart2 = new Chart(document.getElementById('card-chart2'), {
9999 label : 'My First dataset' ,
100100 backgroundColor : 'transparent' ,
101101 borderColor : 'rgba(255,255,255,.55)' ,
102- pointBackgroundColor : getStyle ( '--info' ) ,
102+ pointBackgroundColor : coreui . Utils . getStyle ( '--info' ) ,
103103 data : [ 1 , 18 , 9 , 17 , 34 , 22 , 11 ]
104104 }
105105 ]
@@ -194,7 +194,7 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
194194 backgroundColor : 'rgba(255,255,255,.2)' ,
195195 borderColor : 'rgba(255,255,255,.55)' ,
196196 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
198198 }
199199 ] ,
200200 } ,
@@ -222,24 +222,24 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
222222 datasets : [
223223 {
224224 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' ) ,
227227 pointHoverBackgroundColor : '#fff' ,
228228 borderWidth : 2 ,
229229 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 ]
230230 } ,
231231 {
232232 label : 'My Second dataset' ,
233233 backgroundColor : 'transparent' ,
234- borderColor : getStyle ( '--success' ) ,
234+ borderColor : coreui . Utils . getStyle ( '--success' ) ,
235235 pointHoverBackgroundColor : '#fff' ,
236236 borderWidth : 2 ,
237237 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 ]
238238 } ,
239239 {
240240 label : 'My Third dataset' ,
241241 backgroundColor : 'transparent' ,
242- borderColor : getStyle ( '--danger' ) ,
242+ borderColor : coreui . Utils . getStyle ( '--danger' ) ,
243243 pointHoverBackgroundColor : '#fff' ,
244244 borderWidth : 1 ,
245245 borderDash : [ 8 , 5 ] ,
@@ -285,80 +285,3 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
285285 }
286286 }
287287} )
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