Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

Commit ac6cdae

Browse files
committedJun 15, 2019
fix(main): labelColor callback for CustomTooltips
1 parent db328ca commit ac6cdae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/js/src/main.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Chart.defaults.global.tooltips.enabled = false
1616
Chart.defaults.global.tooltips.mode = 'index'
1717
Chart.defaults.global.tooltips.position = 'nearest'
1818
Chart.defaults.global.tooltips.custom = CustomTooltips
19+
Chart.defaults.global.tooltips.intersect = true
20+
Chart.defaults.global.tooltips.callbacks.labelColor = function (tooltipItem, chart) {
21+
return {
22+
backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor
23+
}
24+
}
1925

2026
// eslint-disable-next-line no-unused-vars
2127
const cardChart1 = new Chart($('#card-chart1'), {

0 commit comments

Comments
 (0)