Skip to content

Commit 4005cd3

Browse files
authored
Merge pull request #4542 from Sebastian-Webster/fix-transparent-background
fix(#4541): fixed transparent background not appearing with dark mode
2 parents fd8af2d + 0d2907b commit 4005cd3

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/modules/Core.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ export default class Core {
9696
})
9797

9898
gl.dom.Paper.node.style.background =
99-
cnf.theme.mode === 'dark' && !cnf.chart.background
100-
? 'rgba(0, 0, 0, 0.8)'
99+
cnf.theme.mode === 'dark' && !cnf.chart.background
100+
? '#424242'
101+
: cnf.theme.mode === 'light' && !cnf.chart.background
102+
? '#fff'
101103
: cnf.chart.background
102104

103105
this.setSVGDimensions()

src/modules/Theme.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ export default class Theme {
179179
options.chart = options.chart || {}
180180
options.tooltip = options.tooltip || {}
181181
const mode = options.theme.mode
182-
const background = mode === 'dark'
183-
? '#424242'
184-
: mode === 'light'
185-
? '#fff'
186-
: options.chart.background || '#fff'
187182
const palette = mode === 'dark'
188183
? 'palette4'
189184
: mode === 'light'
@@ -197,7 +192,6 @@ export default class Theme {
197192

198193
options.tooltip.theme = mode || 'light'
199194
options.chart.foreColor = foreColor
200-
options.chart.background = background
201195
options.theme.palette = palette
202196

203197
return options

src/modules/settings/Config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,6 @@ export default class Config {
277277
opts.chart.foreColor = '#f6f7f8'
278278
}
279279

280-
if (!opts.chart.background) {
281-
opts.chart.background = '#424242'
282-
}
283-
284280
if (!opts.theme.palette) {
285281
opts.theme.palette = 'palette4'
286282
}

src/modules/settings/Options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export default class Options {
270270
speed: 350,
271271
},
272272
},
273-
background: 'transparent',
273+
background: '',
274274
locales: [en],
275275
defaultLocale: 'en',
276276
dropShadow: {
@@ -1115,7 +1115,7 @@ export default class Options {
11151115
},
11161116
yaxis: this.yAxis,
11171117
theme: {
1118-
mode: 'light',
1118+
mode: '',
11191119
palette: 'palette1', // If defined, it will overwrite globals.colors variable
11201120
monochrome: {
11211121
// monochrome allows you to select just 1 color and fill out the rest with light/dark shade (intensity can be selected)

0 commit comments

Comments
 (0)