@@ -15,6 +15,11 @@ Chart.defaults.plugins.tooltip.position = 'nearest'
1515Chart . defaults . plugins . tooltip . external = coreui . ChartJS . customTooltips
1616Chart . defaults . defaultFontColor = '#646470'
1717
18+ const random = ( min , max ) => {
19+ // eslint-disable-next-line no-mixed-operators
20+ return Math . floor ( Math . random ( ) * ( max - min + 1 ) + min )
21+ }
22+
1823// eslint-disable-next-line no-unused-vars
1924const cardChart1 = new Chart ( document . getElementById ( 'card-chart1' ) , {
2025 type : 'line' ,
@@ -225,31 +230,47 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
225230const mainChart = new Chart ( document . getElementById ( 'main-chart' ) , {
226231 type : 'line' ,
227232 data : {
228- labels : [ 'M ' , 'T ' , 'W ' , 'T ' , 'F ' , 'S ' , 'S' , 'M' , 'T' , 'W' , 'T' , 'F' , 'S' , 'S' , 'M' , 'T' , 'W' , 'T' , 'F' , 'S' , 'S' , 'M' , 'T' , 'W' , 'T' , 'F' , 'S' , 'S '] ,
233+ labels : [ 'January ' , 'February ' , 'March ' , 'April ' , 'May ' , 'June ' , 'July ' ] ,
229234 datasets : [
230235 {
231236 label : 'My First dataset' ,
232237 backgroundColor : coreui . Utils . hexToRgba ( coreui . Utils . getStyle ( '--cui-info' ) , 10 ) ,
233238 borderColor : coreui . Utils . getStyle ( '--cui-info' ) ,
234239 pointHoverBackgroundColor : '#fff' ,
235240 borderWidth : 2 ,
236- 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 ] ,
241+ data : [
242+ random ( 50 , 200 ) ,
243+ random ( 50 , 200 ) ,
244+ random ( 50 , 200 ) ,
245+ random ( 50 , 200 ) ,
246+ random ( 50 , 200 ) ,
247+ random ( 50 , 200 ) ,
248+ random ( 50 , 200 )
249+ ] ,
237250 fill : true
238251 } ,
239252 {
240253 label : 'My Second dataset' ,
241254 borderColor : coreui . Utils . getStyle ( '--cui-success' ) ,
242255 pointHoverBackgroundColor : '#fff' ,
243256 borderWidth : 2 ,
244- 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 ]
257+ data : [
258+ random ( 50 , 200 ) ,
259+ random ( 50 , 200 ) ,
260+ random ( 50 , 200 ) ,
261+ random ( 50 , 200 ) ,
262+ random ( 50 , 200 ) ,
263+ random ( 50 , 200 ) ,
264+ random ( 50 , 200 )
265+ ]
245266 } ,
246267 {
247268 label : 'My Third dataset' ,
248269 borderColor : coreui . Utils . getStyle ( '--cui-danger' ) ,
249270 pointHoverBackgroundColor : '#fff' ,
250271 borderWidth : 1 ,
251272 borderDash : [ 8 , 5 ] ,
252- data : [ 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 , 65 ]
273+ data : [ 65 , 65 , 65 , 65 , 65 , 65 , 65 ]
253274 }
254275 ]
255276 } ,
0 commit comments