Skip to content

Optimizing Chart for Dark Mode. Legend and Axis turn color to white … #75

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/components/Log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
@click="showBtnExplaination = true">Why don't I see this immediately?</p>
</v-card>
<v-card v-show="showChart">
<chart-line ref="chart"></chart-line>
<v-container class="btn-container">
<v-btn small color="primary" @click="showChart = false">Show summary</v-btn>
</v-container>
<chart-line ref="chart"></chart-line>
</v-card>
<v-card v-show="showMap">
<v-container class="btn-container">
Expand All @@ -112,6 +112,7 @@

<script>
import { Line } from 'vue-chartjs';
import storage from '../utils/storage';

export default {
data: () => ({
Expand Down Expand Up @@ -277,6 +278,13 @@
return avgValues.reverse();

},
sparklinecolor() {
if(storage.getValue('darkMode', false) == true) {
return "white";
}
else
return "black";
},
chartData() {
const self = this;
const stats = [...self.log.stats].sort((a, b) => a.timestamp - b.timestamp);
Expand All @@ -295,7 +303,7 @@
}, {
label: 'DC Battery Power',
key: 'dc_battery_power',
color: 'darkgreen'
color: 'green'
}, {
label: 'Battery temperature (Min)',
key: 'battery_min_temperature',
Expand Down Expand Up @@ -359,9 +367,20 @@
xAxes: [{
ticks: {
autoSkip: true,
maxTicksLimit: 15
maxTicksLimit: 15,
fontColor: this.sparklinecolor
}
}],
yAxes: [{
ticks:{
fontColor: this.sparklinecolor
}
}]
}]
},
legend: {
labels: {
fontColor: this.sparklinecolor
}
}
});
});
Expand Down