From 5448b72f7ca1c58dcee38213ccf7453156624e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Fri, 18 Jan 2019 06:57:00 +0100 Subject: [PATCH] Passed the theme to Gauge --- public/app/plugins/panel/gauge/GaugePanel.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index eb00caf55fb..52ee273ef21 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -1,12 +1,17 @@ import React, { PureComponent } from 'react'; -import { PanelProps, NullValueMode, Gauge } from '@grafana/ui'; +import { PanelProps, NullValueMode, Gauge, Themes } from '@grafana/ui'; import { getTimeSeriesVMs } from './timeSeries'; import { GaugeOptions } from './types'; +import { contextSrv } from 'app/core/core'; interface Props extends PanelProps {} export class GaugePanel extends PureComponent { + getTheme() { + return contextSrv.user.lightTheme ? Themes.Light : Themes.Dark; + } + render() { const { timeSeries, width, height, onInterpolate, options } = this.props; @@ -26,6 +31,7 @@ export class GaugePanel extends PureComponent { height={height} prefix={prefix} suffix={suffix} + theme={this.getTheme()} /> ); }