@@ -21,6 +21,7 @@ import {
2121 Table ,
2222} from 'reactstrap' ;
2323import Widget03 from '../../views/Widgets/Widget03'
24+ import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips' ;
2425
2526const brandPrimary = '#20a8d8' ;
2627const brandSuccess = '#4dbd74' ;
@@ -42,6 +43,10 @@ const cardChartData1 = {
4243} ;
4344
4445const cardChartOpts1 = {
46+ tooltips : {
47+ enabled : false ,
48+ custom : CustomTooltips
49+ } ,
4550 maintainAspectRatio : false ,
4651 legend : {
4752 display : false ,
@@ -78,8 +83,9 @@ const cardChartOpts1 = {
7883 hitRadius : 10 ,
7984 hoverRadius : 4 ,
8085 } ,
81- } ,
82- } ;
86+ }
87+ }
88+
8389
8490// Card Chart 2
8591const cardChartData2 = {
@@ -95,6 +101,10 @@ const cardChartData2 = {
95101} ;
96102
97103const cardChartOpts2 = {
104+ tooltips : {
105+ enabled : false ,
106+ custom : CustomTooltips
107+ } ,
98108 maintainAspectRatio : false ,
99109 legend : {
100110 display : false ,
@@ -149,6 +159,10 @@ const cardChartData3 = {
149159} ;
150160
151161const cardChartOpts3 = {
162+ tooltips : {
163+ enabled : false ,
164+ custom : CustomTooltips
165+ } ,
152166 maintainAspectRatio : false ,
153167 legend : {
154168 display : false ,
@@ -189,6 +203,10 @@ const cardChartData4 = {
189203} ;
190204
191205const cardChartOpts4 = {
206+ tooltips : {
207+ enabled : false ,
208+ custom : CustomTooltips
209+ } ,
192210 maintainAspectRatio : false ,
193211 legend : {
194212 display : false ,
@@ -233,6 +251,10 @@ const makeSocialBoxData = (dataSetNo) => {
233251} ;
234252
235253const socialChartOpts = {
254+ tooltips : {
255+ enabled : false ,
256+ custom : CustomTooltips
257+ } ,
236258 responsive : true ,
237259 maintainAspectRatio : false ,
238260 legend : {
@@ -303,6 +325,10 @@ const makeSparkLineData = (dataSetNo, variant) => {
303325} ;
304326
305327const sparklineChartOpts = {
328+ tooltips : {
329+ enabled : false ,
330+ custom : CustomTooltips
331+ } ,
306332 responsive : true ,
307333 maintainAspectRatio : true ,
308334 scales : {
@@ -361,7 +387,7 @@ for (var i = 0; i <= elements; i++) {
361387}
362388
363389const 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 ' ] ,
365391 datasets : [
366392 {
367393 label : 'My First dataset' ,
@@ -392,6 +418,18 @@ const mainChart = {
392418} ;
393419
394420const 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+ } ,
395433 maintainAspectRatio : false ,
396434 legend : {
397435 display : false ,
0 commit comments