Skip to content

Commit cdddb44

Browse files
committed
Fix bar chart color for dark mode Stigmatoz#79
- Return dark mode to color #121212
1 parent 667a02c commit cdddb44

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/scripts/chart/chart-core.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function donutChart() {
245245
return chart;
246246
}
247247

248-
function barChart(data) {
248+
function barChart(data, darkMode) {
249249
var margin = { top: 25, right: 5, bottom: 25, left: 5 },
250250
width = 555,
251251
height = 160;
@@ -298,10 +298,17 @@ function barChart(data) {
298298
// add the x Axis
299299
svg.append("g")
300300
.attr("transform", "translate(0," + height + ")")
301+
.style("stroke", darkMode ? "white" : "")
302+
.style("stroke-width", darkMode ? "0.5px" : "")
301303
.call(d3.axisBottom(x));
302304

303305
if (data.length > 9)
304306
document.querySelectorAll('#barChart g.tick ').forEach(element => { element.remove() });
307+
308+
if (darkMode){
309+
document.querySelector("#barChart path").setAttribute("stroke", "white");
310+
document.querySelectorAll('#barChart g.tick line').forEach(element => { element.setAttribute("stroke", "white") });
311+
}
305312
}
306313

307314
function drawIntervalChart(data) {

src/scripts/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class UI {
112112

113113
drawBarChart(days) {
114114
d3.select('#barChart').datum(days);
115-
barChart(days);
115+
barChart(days, setting_dark_mode);
116116
}
117117

118118
addTableHeader(currentTypeOfList, counterOfSite, totalTime, totalDays) {

src/style/webact.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ input[type='checkbox'] {
531531

532532
.dark-mode {
533533
color: #ffffff !important;
534-
background-color: #474747 !important;
534+
background-color: #121212 !important;
535535
}
536536

537537
.dark-mode .span-active-time {
@@ -563,6 +563,14 @@ input[type='checkbox'] {
563563
color: #ffffff;
564564
}
565565

566+
.dark-mode .inline-flex .p-visits {
567+
color: #ffffff;
568+
}
569+
570+
.dark-mode .inline-flex:hover .p-visits {
571+
color: #ffffff;
572+
}
573+
566574
.dark-mode .span-time {
567575
color: #a5a5a5;
568576
}

0 commit comments

Comments
 (0)