Tooltip colors for Pie/Donut charts don't reflect custom colors
See original GitHub issueDescription
Can’t seem to change the color of the tooltip and the donut labels displayed inside the chart. I updated the colors for the legend and the actual slices but not the tooltip and inside label.
Steps to Reproduce
- Pass in custom colors for the chart
- Modify the legend and tooltip to use them
- See that the tooltip is not reflected including the labels
Chart options that reproduce the issue:
var options = {
chart: {
height: 380,
width: "100%",
type: "donut",
labels: ["Apple", "Orange", "Mango"]
},
fill: {
colors: ["#f44336", "#ff9800", "#4caf50"]
},
series: [1, 5, 10],
legend: {
// Show the legend
show: true,
markers: {
// Set the legend colors as the ones passed in
fillColors: ["#f44336", "#ff9800", "#4caf50"]
}
},
tooltip: {
enabled: true,
fillSeriesColor: true
}
};
Expected Behavior
The tooltip and the inside labels should use the same colors as the chart slices and legend.
Screenshots
Reproduction Link
See the code here: https://codepen.io/stanivanov/pen/WNXZvZE
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Apex Chart donut chart the tooltip color isn't same with series
I am trying to change ApexChart tooltip background colors but i couldn't do it. They aren't same with the series colors.
Read more >series.pie.colors | highcharts API Reference
The center of the pie chart relative to the plot area. ... Changes to the series' color will also be reflected in a...
Read more >Tooltip - Chart.js
The bubble, doughnut, pie, polar area, and scatter charts override the tooltip defaults ... Color boxes are always aligned to the left edge....
Read more >Chart TOOLTIP on Mouse HOVER - An Entire Dashboard in ...
But, when we hover with the mouse over any column, a dynamic tooltip appears showing related information in a donut and a Bar...
Read more >How to Change the Font Colors of the Tooltip Labels in Chart.js
With chart js you can make line chart, bar chart, pie chart, doughnut chart, scatter chart, polar area chart, radar chart, gauge chart...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same problem when forcing chart colours as you did. To fix this issue I had assigned the same colours array used in options.fill.colors to options.colors
You are right about using the
color
array, but I also had to remove thefillSeriesColor
option in thetooltip
array.This didn’t work:
But this does and fixes the issue: