Closed gotzsys closed 11 months ago
Can confirm that this does happen sometimes. I tried to use the "title" option and the same thing happened. I have to switch from dark back to light mode many times for the black text to show instead of white.
Check this out.. I submit issue but found a solution
https://github.com/leandrocfe/filament-apex-charts/issues/25#issuecomment-1574629367
It's not really a solution though. #9ca3af
is essentially the only color that you can use for legend labels, etc... only because the color looks okay in both light and dark. I think it would be a lot better if dark mode was actually supported with chart text, but I'm not sure how that would be done unless the package owner decided to override something from apex charts.
So, in my opinion, it may not be an issue, but I think it is definitely a flaw...
The problem is here... /resources/views/widgets/components/chart.blade.php
localStorage.getItem('theme') || (document.documentElement.classList.contains('dark') ? 'dark' : 'light')
I'm not sure if that is the actual issue but I actually found a solution by overriding the CSS class of whatever I am trying to use in filament.css
like this:
.apexcharts-title-text {
fill: #111827;
}
.dark .apexcharts-title-text {
fill: #ffffff;
}
This actually looks promising to me for many things considering the CSS of almost everything in apex charts is not influenced by TailwindCSS at all.
Theme set to dark mode
Theme changed to light mode.
@leandrocfe, procede?
Theme set to dark mode
Theme changed to light mode.
![]()
@leandrocfe, procede?
Sim, eu vou remover e deixar somente pela classe. Tenho umas melhorias pra lançar junto com isso. Acho que até a próxima semana 👍
Boa, muito obrigado @leandrocfe ! Abraço e bom final de semana
Boa, muito obrigado @leandrocfe ! Abraço e bom final de semana
Valeu. Bom fim de semana
Hi @gotzsys, Would you like to try this version?
composer require leandrocfe/filament-apex-charts:"^2.0"
Hi @leandrocfe, sorry for the late reply, the adjustment worked out well, thank you very much!
When I change from dark to light mode, the colors are set correctly.![image](https://github.com/leandrocfe/filament-apex-charts/assets/13874850/9183e219-1e0a-4074-8275-aa263afd776d)
However, when I refresh the page, this problem occurs.![image](https://github.com/leandrocfe/filament-apex-charts/assets/13874850/5433b846-648e-49be-947c-0b6a06a1138a)