File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,9 @@ 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' ) {
@@ -273,6 +274,14 @@ const mainChart = new Chart(document.getElementById('main-chart'), {
273274 hoverRadius : 4 ,
274275 hoverBorderWidth : 3
275276 }
277+ } ,
278+ tooltips : {
279+ intersect : true ,
280+ callbacks : {
281+ labelColor : function ( tooltipItem , chart ) {
282+ return { backgroundColor : chart . data . datasets [ tooltipItem . datasetIndex ] . borderColor } ;
283+ }
284+ }
276285 }
277286 }
278287} )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Chart.defaults.global.pointHitDetectionRadius = 1
1313Chart . defaults . global . tooltips . enabled = false
1414Chart . defaults . global . tooltips . mode = 'index'
1515Chart . defaults . global . tooltips . position = 'nearest'
16- Chart . defaults . global . tooltips . custom = coreui . ChartJS . CustomTooltips
16+ Chart . defaults . global . tooltips . custom = coreui . ChartJS . customTooltips
1717
1818document . body . addEventListener ( 'classtoggle' , event => {
1919 if ( event . detail . className === 'c-dark-theme' ) {
You can’t perform that action at this time.
0 commit comments