Tweak the previous use of graphPalette to be the right way around

This commit is contained in:
Herbert Wolverson 2024-07-22 16:36:48 -05:00
parent 35b54dd121
commit 052b8cbde8
2 changed files with 17 additions and 17 deletions

View File

@ -6,7 +6,6 @@ export class DashboardGraph {
this.dom = document.getElementById(id);
this.dom.classList.add("muted");
if (isDarkMode()) {
this.chart = echarts.init(this.dom, 'dark');
window.graphPalette = [
'#4992ff',
'#7cffb2',
@ -18,8 +17,8 @@ export class DashboardGraph {
'#8d48e3',
'#dd79ff'
];
this.chart = echarts.init(this.dom, 'dark');
} else {
this.chart = echarts.init(this.dom, 'vintage');
window.graphPalette = [
'#d87c7c',
'#919e8b',
@ -32,6 +31,7 @@ export class DashboardGraph {
'#724e58',
'#4b565b'
];
this.chart = echarts.init(this.dom, 'vintage');
}
this.chart.showLoading();
this.option = {};

View File

@ -23,21 +23,6 @@ export function initDayNightMode() {
document.body.classList.add('dark-mode');
document.documentElement.setAttribute('data-bs-theme', "dark");
localStorage.setItem('theme', 'dark');
window.graphPalette = [
'#4992ff',
'#7cffb2',
'#fddd60',
'#ff6e76',
'#58d9f9',
'#05c091',
'#ff8a45',
'#8d48e3',
'#dd79ff'
];
} else {
document.body.classList.remove('dark-mode');
document.documentElement.setAttribute('data-bs-theme', "light");
localStorage.setItem('theme', 'light');
window.graphPalette = [
'#d87c7c',
'#919e8b',
@ -50,6 +35,21 @@ export function initDayNightMode() {
'#724e58',
'#4b565b'
];
} else {
document.body.classList.remove('dark-mode');
document.documentElement.setAttribute('data-bs-theme', "light");
localStorage.setItem('theme', 'light');
window.graphPalette = [
'#4992ff',
'#7cffb2',
'#fddd60',
'#ff6e76',
'#58d9f9',
'#05c091',
'#ff8a45',
'#8d48e3',
'#dd79ff'
];
}
if (window.graphList !== undefined) {
window.graphList.forEach((graph) => {