Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a full dark theme #218

Closed
steebchen opened this issue Nov 30, 2018 · 24 comments
Closed

Add a full dark theme #218

steebchen opened this issue Nov 30, 2018 · 24 comments
Labels
feature-request New feature or request

Comments

@steebchen
Copy link

For dark themes, there's the tooltip.theme option. It looks nice, but it would be very cool if the whole thing could have a dark mode.

selection_999 482

With some minor tweaks like setting the text color to white and adding dark colors to the menu, it could look like this

selection_999 484

I would suggest to use a top-level theme (or chart.theme) option, add a class dark to .apexcharts-canvas and style all other elements with css selectors accordingly.

I could send a PR for this if my proposal seems like a good idea (although not in the next few days).

BTW, huge thanks to this project. The charts are so clean and even mobile touch "swiping" of the charts always renders the correct tooltip. This is so cool!

@junedchhipa junedchhipa added the feature-request New feature or request label Dec 1, 2018
@junedchhipa
Copy link
Contributor

Thanks for the kind words!
Sure, there is already a property called theme in the main configuration - https://apexcharts.com/docs/options/theme/

Maybe we can add theme.mode: 'light' / 'dark' in the same property and carry on that.

@elbojoloco
Copy link

Has this been released yet? Looking for an easy way to switch dark/light themes aswell, using with Vuetify atm.

@junedchhipa
Copy link
Contributor

Not released yet, but coming soon.

@pilotaids
Copy link

@junedchhipa any chance you can explain how to modify the charts to show properly when using vuetify dark mode?
I have the problem @steebchen shows in the first pic, but I cannot find the proper options I need to modify to create the layout in the second picture above (where you can see the text).
Thank you in advance

@steebchen
Copy link
Author

I abandoned this project so I'm not sure but I'm sure you can use:

svg text {
	fill: white;
}

@junedchhipa
Copy link
Contributor

junedchhipa commented May 15, 2019

@steebchen May I know the reason why you abandoned?
@pilotaids What have you tried to change the theme? Did you updated this option theme.mode?
Also, the tooltip is an HTML element, so directly modifying the background/color options will work too.

@steebchen
Copy link
Author

I meant I abandoned my own project, not using apexcharts (although that results in it). In general, it seems I'm quickly transitioning into Angular (100% Typescript, powerful testing, DI, intellisense, ...).

@junedchhipa
Copy link
Contributor

Ah! thanks for clarifying!
Good luck with Angular. I'm sure you'll enjoy it too along with ng-apexcharts ;)

@steebchen
Copy link
Author

Ah well, good to know ;) Will definitely use it when I need charts in Angular!

@bubuamu
Copy link

bubuamu commented Jun 18, 2019

i want to add background image on the chart. Do anyone know how

@junedchhipa
Copy link
Contributor

@bubuamu Please create a new ticket for it.

@wobsoriano
Copy link

wobsoriano commented Feb 1, 2020

You can now achieve this by setting the theme property inside tooltip property to dark.

tooltip: {
   theme: 'dark',
}

Dark Theme

@chitgoks
Copy link

apex

question. how come the background for the charts is not dark gray? i didnt set any background color either.

the dark gray color below is a material table in dark mode which is correct.

@kamilcglr
Copy link

apex

question. how come the background for the charts is not dark gray? i didnt set any background color either.

the dark gray color below is a material table in dark mode which is correct.

Hello, did you find a solution ?

@chitgoks
Copy link

apex
question. how come the background for the charts is not dark gray? i didnt set any background color either.
the dark gray color below is a material table in dark mode which is correct.

Hello, did you find a solution ?

no. not going to. this is a personal project anyway so ill just wait for them to fix it.

@junedchhipa
Copy link
Contributor

I have changed the default dark color to #424242

@kamilcglr
Copy link

kamilcglr commented Apr 22, 2020

I have changed the default dark color to #424242

Ok thank you very much for the quick response.
But, is there any way to change this color ourselves?

I would like to put it transparent so that the background color is the same as the vuetify color.
It doesn't work when I do :

chart: {
            background: 'transparent'
 }

Anyway, great job on that library.

@lkovesdi
Copy link

Yeah is there a way to remove the dark mode background? I have my charts on dark already.
Screen Shot 2020-04-28 at 3 24 26 PM

@sauterl
Copy link

sauterl commented May 18, 2020

For those that came here, like myself or the previous comment, using other style means, such as e.g. material-design, put

div.apexcharts-canvas.apexcharts-theme-dark {
  background: transparent !important;
}

in your css file somewhere (in case of an angular app, style.css).

@hothvictor
Copy link

svg.apexcharts-svg { background: transparent !important; }

@dmytrostrembetskyi
Copy link

you can achieve this by this

chart: {
    background: 'rgba(0, 0, 0, 0)'
}

@ghost
Copy link

ghost commented Mar 11, 2022

what should we do If there is both theme dark and light what should we do for text color?

@vinosamari
Copy link

This hack works with vuetify to show white text in dark mode. Place it inside the app.vue file so that it's not a scoped style.

.theme--dark svg text {
  fill: white !important;
}
.theme--dark .apexcharts-legend-text {
  color: white !important;
  fill: white !important;
}

@surister
Copy link

This hack works with vuetify to show white text in dark mode. Place it inside the app.vue file so that it's not a scoped style.

.theme--dark svg text {
  fill: white !important;
}
.theme--dark .apexcharts-legend-text {
  color: white !important;
  fill: white !important;
}

Did not work for me for "vuetify": "^3.0.0" , the actual class name is .v-theme--dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests