From 2eb65616ebaabafe9ed01920469a2a5e2667739e Mon Sep 17 00:00:00 2001 From: Daan Wijns Date: Fri, 29 May 2020 20:34:04 +0200 Subject: [PATCH] chart tooltip dark theme --- src/components/Navbar.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index da581e77..171acd61 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -309,6 +309,9 @@ export default { opacityTo: 0.5, stops: [0, 50, 100] } + }, + tooltip: { + theme: 'light' } }, chartInterval: null @@ -341,6 +344,10 @@ export default { }, toggleSpeed() { qbit.toggleSpeedLimitsMode() + }, + setChartTooltipTheme(theme) { + this.chartOptions.tooltip.theme = theme.toLowerCase() + this.$refs.chart.updateOptions(this.chartOptions) } }, computed: { @@ -369,6 +376,14 @@ export default { }, created() { this.$vuetify.theme.dark = this.getTheme() + }, + mounted() { + this.setChartTooltipTheme(this.theme) + }, + watch: { + theme(newValue) { + this.setChartTooltipTheme(newValue) + } } }