@@ -21,6 +21,7 @@ import {
21
21
Table ,
22
22
} from 'reactstrap' ;
23
23
import Widget03 from '../../views/Widgets/Widget03'
24
+ import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips' ;
24
25
25
26
const brandPrimary = '#20a8d8' ;
26
27
const brandSuccess = '#4dbd74' ;
@@ -42,6 +43,10 @@ const cardChartData1 = {
42
43
} ;
43
44
44
45
const cardChartOpts1 = {
46
+ tooltips : {
47
+ enabled : false ,
48
+ custom : CustomTooltips
49
+ } ,
45
50
maintainAspectRatio : false ,
46
51
legend : {
47
52
display : false ,
@@ -78,8 +83,9 @@ const cardChartOpts1 = {
78
83
hitRadius : 10 ,
79
84
hoverRadius : 4 ,
80
85
} ,
81
- } ,
82
- } ;
86
+ }
87
+ }
88
+
83
89
84
90
// Card Chart 2
85
91
const cardChartData2 = {
@@ -95,6 +101,10 @@ const cardChartData2 = {
95
101
} ;
96
102
97
103
const cardChartOpts2 = {
104
+ tooltips : {
105
+ enabled : false ,
106
+ custom : CustomTooltips
107
+ } ,
98
108
maintainAspectRatio : false ,
99
109
legend : {
100
110
display : false ,
@@ -149,6 +159,10 @@ const cardChartData3 = {
149
159
} ;
150
160
151
161
const cardChartOpts3 = {
162
+ tooltips : {
163
+ enabled : false ,
164
+ custom : CustomTooltips
165
+ } ,
152
166
maintainAspectRatio : false ,
153
167
legend : {
154
168
display : false ,
@@ -189,6 +203,10 @@ const cardChartData4 = {
189
203
} ;
190
204
191
205
const cardChartOpts4 = {
206
+ tooltips : {
207
+ enabled : false ,
208
+ custom : CustomTooltips
209
+ } ,
192
210
maintainAspectRatio : false ,
193
211
legend : {
194
212
display : false ,
@@ -233,6 +251,10 @@ const makeSocialBoxData = (dataSetNo) => {
233
251
} ;
234
252
235
253
const socialChartOpts = {
254
+ tooltips : {
255
+ enabled : false ,
256
+ custom : CustomTooltips
257
+ } ,
236
258
responsive : true ,
237
259
maintainAspectRatio : false ,
238
260
legend : {
@@ -303,6 +325,10 @@ const makeSparkLineData = (dataSetNo, variant) => {
303
325
} ;
304
326
305
327
const sparklineChartOpts = {
328
+ tooltips : {
329
+ enabled : false ,
330
+ custom : CustomTooltips
331
+ } ,
306
332
responsive : true ,
307
333
maintainAspectRatio : true ,
308
334
scales : {
@@ -361,7 +387,7 @@ for (var i = 0; i <= elements; i++) {
361
387
}
362
388
363
389
const mainChart = {
364
- 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 ' ] ,
390
+ labels : [ 'Mo ' , 'Tu ' , 'We ' , 'Th ' , 'Fr ' , 'Sa ' , 'Su ' , 'Mo ' , 'Tu ' , 'We ' , 'Th ' , 'Fr ' , 'Sa ' , 'Su ' , 'Mo ' , 'Tu ' , 'We ' , 'Th ' , 'Fr ' , 'Sa ' , 'Su ' , 'Mo ' , 'Tu ' , 'We ' , 'Th ' , 'Fr ' , 'Sa ' , 'Su ' ] ,
365
391
datasets : [
366
392
{
367
393
label : 'My First dataset' ,
@@ -392,6 +418,18 @@ const mainChart = {
392
418
} ;
393
419
394
420
const mainChartOpts = {
421
+ tooltips : {
422
+ enabled : false ,
423
+ custom : CustomTooltips ,
424
+ intersect : true ,
425
+ mode : 'index' ,
426
+ position : 'nearest' ,
427
+ callbacks : {
428
+ labelColor : function ( tooltipItem , chart ) {
429
+ return { backgroundColor : chart . data . datasets [ tooltipItem . datasetIndex ] . borderColor }
430
+ }
431
+ }
432
+ } ,
395
433
maintainAspectRatio : false ,
396
434
legend : {
397
435
display : false ,
0 commit comments