Skip to content

Commit 3ad0143

Browse files
committed
fix #4932; tooltip color in pie/donut charts
1 parent 1ae6e64 commit 3ad0143

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/assets/apexcharts.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ rect.legend-mouseover-inactive,
170170
text-rendering: optimizeLegibility;
171171
-webkit-font-smoothing: antialiased;
172172
font-size: 26px;
173+
font-family: Arial, Helvetica, sans-serif;
173174
line-height: 14px;
174175
font-weight: 900;
175176
}

src/modules/tooltip/Labels.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export default class Labels {
268268
ttItemsChildren = ttItems[t].children
269269

270270
if (w.config.tooltip.fillSeriesColor) {
271-
ttItems[t].style.color = pColor
271+
ttItems[t].style.backgroundColor = pColor
272272
ttItemsChildren[0].style.display = 'none'
273273
}
274274

@@ -309,7 +309,11 @@ export default class Labels {
309309
pColor = w.config.tooltip.marker.fillColors[t]
310310
}
311311

312-
ttItemsChildren[0].style.color = pColor
312+
if (w.config.tooltip.fillSeriesColor) {
313+
ttItemsChildren[0].style.backgroundColor = pColor
314+
} else {
315+
ttItemsChildren[0].style.color = pColor
316+
}
313317
}
314318

315319
if (!w.config.tooltip.marker.show) {

src/modules/tooltip/Tooltip.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ export default class Tooltip {
147147

148148
let point = document.createElement('span')
149149
point.classList.add('apexcharts-tooltip-marker')
150-
point.style.color = w.globals.colors[i]
150+
151+
if (w.config.tooltip.fillSeriesColor) {
152+
point.style.backgroundColor = w.globals.colors[i]
153+
} else {
154+
point.style.color = w.globals.colors[i]
155+
}
151156

152157
let mShape = w.config.markers.shape
153158
let shape = mShape

0 commit comments

Comments
 (0)