swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Font/Text Color In X axis and Y-Axis labels does not change if theme change #1312

Open yashjit opened 4 years ago

yashjit commented 4 years ago

Describe the bug I have 3 themes in my angular app and on theme change color scheme change in app, but ngx-charts does not respond to it. I Applied all guide provided in issue #740, but it does not work if you change theme at run time, OnTheme change i change the class .dark to respective class but no effect. As SVG generated earlier so may be need to generate SVG again if theme change ?

To Reproduce Steps to reproduce the behavior: My Code -

  1. Change in theme at run rime using a drop down -

changeTheme(name: string): void { this.themeChanges$.next({ name, previous: this.currentTheme }); this.currentTheme = name; }

this.themeService.onThemeChange() .subscribe((theme: any) => { console.log(Theme changed to ${theme.name}); this.currentTheme = theme.name; this.initGraph(); });

  1. HTML -

    3 . CSS -

/ ngx-chart Dynamic style / .dark { /

.default { /**

Expected behavior It should change color of label, font-size but no effect seen.

SamueLacmene commented 4 years ago

I have the same issue

tofiqquadri commented 4 years ago

Try to use my solution at https://github.com/swimlane/ngx-charts/issues/740

@yashjit @MrBob007 you guys can mention all the themes you are using in your application instead of just dark as in my case.

blogcraft commented 4 years ago

There seems to be a problem in which color gets covered by fill in CSS.