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 */
@@ -14,18 +14,19 @@ Chart.defaults.global.pointHitDetectionRadius = 1
1414Chart . defaults . global . tooltips . enabled = false
1515Chart . defaults . global . tooltips . mode = 'index'
1616Chart . defaults . global . tooltips . position = 'nearest'
17- Chart . defaults . global . tooltips . custom = coreui . ChartJS . CustomTooltips
17+ Chart . defaults . global . tooltips . custom = coreui . ChartJS . customTooltips
1818Chart . defaults . global . defaultFontColor = '#646470'
19+ Chart . defaults . global . responsiveAnimationDuration = 1
1920
2021document . body . addEventListener ( 'classtoggle' , event => {
2122 if ( event . detail . className === 'c-dark-theme' ) {
2223 if ( document . body . classList . contains ( 'c-dark-theme' ) ) {
23- cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--primary-dark-theme' )
24- 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' )
2526 Chart . defaults . global . defaultFontColor = '#fff'
2627 } else {
27- cardChart1 . data . datasets [ 0 ] . pointBackgroundColor = getStyle ( '--primary' )
28- 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' )
2930 Chart . defaults . global . defaultFontColor = '#646470'
3031 }
3132
@@ -45,7 +46,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
4546 label : 'My First dataset' ,
4647 backgroundColor : 'transparent' ,
4748 borderColor : 'rgba(255,255,255,.55)' ,
48- pointBackgroundColor : getStyle ( '--primary' ) ,
49+ pointBackgroundColor : coreui . Utils . getStyle ( '--primary' ) ,
4950 data : [ 65 , 59 , 84 , 84 , 51 , 55 , 40 ]
5051 }
5152 ]
@@ -98,7 +99,7 @@ const cardChart2 = new Chart(document.getElementById('card-chart2'), {
9899 label : 'My First dataset' ,
99100 backgroundColor : 'transparent' ,
100101 borderColor : 'rgba(255,255,255,.55)' ,
101- pointBackgroundColor : getStyle ( '--info' ) ,
102+ pointBackgroundColor : coreui . Utils . getStyle ( '--info' ) ,
102103 data : [ 1 , 18 , 9 , 17 , 34 , 22 , 11 ]
103104 }
104105 ]
@@ -192,7 +193,8 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
192193 label : 'My First dataset' ,
193194 backgroundColor : 'rgba(255,255,255,.2)' ,
194195 borderColor : 'rgba(255,255,255,.55)' ,
195- data : [ 78 , 81 , 80 , 45 , 34 , 12 , 40 , 85 , 65 , 23 , 12 , 98 , 34 , 84 , 67 , 82 ]
196+ data : [ 78 , 81 , 80 , 45 , 34 , 12 , 40 , 85 , 65 , 23 , 12 , 98 , 34 , 84 , 67 , 82 ] ,
197+ barPercentage : 0.6
196198 }
197199 ]
198200 } ,
@@ -203,8 +205,7 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
203205 } ,
204206 scales : {
205207 xAxes : [ {
206- display : false ,
207- barPercentage : 0.6
208+ display : false
208209 } ] ,
209210 yAxes : [ {
210211 display : false
@@ -221,24 +222,24 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
221222 datasets : [
222223 {
223224 label : 'My First dataset' ,
224- backgroundColor : hexToRgba ( getStyle ( '--info' ) , 10 ) ,
225- borderColor : getStyle ( '--info' ) ,
225+ backgroundColor : coreui . Utils . hexToRgba ( coreui . Utils . getStyle ( '--info' ) , 10 ) ,
226+ borderColor : coreui . Utils . getStyle ( '--info' ) ,
226227 pointHoverBackgroundColor : '#fff' ,
227228 borderWidth : 2 ,
228229 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 ]
229230 } ,
230231 {
231232 label : 'My Second dataset' ,
232233 backgroundColor : 'transparent' ,
233- borderColor : getStyle ( '--success' ) ,
234+ borderColor : coreui . Utils . getStyle ( '--success' ) ,
234235 pointHoverBackgroundColor : '#fff' ,
235236 borderWidth : 2 ,
236237 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 ]
237238 } ,
238239 {
239240 label : 'My Third dataset' ,
240241 backgroundColor : 'transparent' ,
241- borderColor : getStyle ( '--danger' ) ,
242+ borderColor : coreui . Utils . getStyle ( '--danger' ) ,
242243 pointHoverBackgroundColor : '#fff' ,
243244 borderWidth : 1 ,
244245 borderDash : [ 8 , 5 ] ,
@@ -276,80 +277,3 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
276277 }
277278 }
278279} )
279-
280- const brandBoxChartLabels = [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ]
281-
282- const brandBoxChartOptions = {
283- responsive : true ,
284- maintainAspectRatio : false ,
285- legend : {
286- display : false
287- } ,
288- scales : {
289- xAxes : [ {
290- display :false
291- } ] ,
292- yAxes : [ {
293- display :false
294- } ]
295- } ,
296- elements : {
297- point : {
298- radius : 0 ,
299- hitRadius : 10 ,
300- hoverRadius : 4 ,
301- hoverBorderWidth : 3
302- }
303- }
304- }
305-
306- // eslint-disable-next-line no-unused-vars
307- const brandBoxChart1 = new Chart ( document . getElementById ( 'social-box-chart-1' ) , {
308- type : 'line' ,
309- data : {
310- labels : brandBoxChartLabels ,
311- datasets : [ {
312- label : 'My First dataset' ,
313- backgroundColor : 'rgba(255,255,255,.1)' ,
314- borderColor : 'rgba(255,255,255,.55)' ,
315- pointHoverBackgroundColor : '#fff' ,
316- borderWidth : 2 ,
317- data : [ 65 , 59 , 84 , 84 , 51 , 55 , 40 ]
318- } ]
319- } ,
320- options : brandBoxChartOptions
321- } )
322-
323- // eslint-disable-next-line no-unused-vars
324- const brandBoxChart2 = new Chart ( document . getElementById ( 'social-box-chart-2' ) , {
325- type : 'line' ,
326- data : {
327- labels : brandBoxChartLabels ,
328- datasets : [ {
329- label : 'My First dataset' ,
330- backgroundColor : 'rgba(255,255,255,.1)' ,
331- borderColor : 'rgba(255,255,255,.55)' ,
332- pointHoverBackgroundColor : '#fff' ,
333- borderWidth : 2 ,
334- data : [ 1 , 13 , 9 , 17 , 34 , 41 , 38 ]
335- } ]
336- } ,
337- options : brandBoxChartOptions
338- } )
339-
340- // eslint-disable-next-line no-unused-vars
341- const brandBoxChart3 = new Chart ( document . getElementById ( 'social-box-chart-3' ) , {
342- type : 'line' ,
343- data : {
344- labels : brandBoxChartLabels ,
345- datasets : [ {
346- label : 'My First dataset' ,
347- backgroundColor : 'rgba(255,255,255,.1)' ,
348- borderColor : 'rgba(255,255,255,.55)' ,
349- pointHoverBackgroundColor : '#fff' ,
350- borderWidth : 2 ,
351- data : [ 78 , 81 , 80 , 45 , 34 , 12 , 40 ]
352- } ]
353- } ,
354- options : brandBoxChartOptions
355- } )
0 commit comments