diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.tsx index 174a4c0a7ca..be20ac7e159 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.tsx @@ -175,7 +175,7 @@ export class Gauge extends PureComponent { return (
{ let vizWidth = width; let vizHeight = height; - if (orientation === 'horizontal' || width > height) { + if ((orientation && orientation === 'horizontal') || width > height) { vizContainerStyle = horizontalVisualization; vizWidth = repeatingVizWidth; } - if (orientation === 'vertical' || height > width) { + if ((orientation && orientation === 'vertical') || height > width) { vizContainerStyle = verticalVisualization; vizHeight = repeatingVizHeight; } diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index 4381338d640..47c610ab78f 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -45,14 +45,14 @@ export class GaugePanel extends PureComponent { const { options, width, height } = this.props; const value = timeSeries[0].stats[options.valueOptions.stat]; - return
{this.renderGauge(value, width, height)}
; + return
{this.renderGauge(value, width, height)}
; } renderGaugeWithTableData(panelData) { const { width, height } = this.props; const firstTableDataValue = panelData.tableData.rows[0].find(prop => prop > 0); - return
{this.renderGauge(firstTableDataValue, width, height)}
; + return
{this.renderGauge(firstTableDataValue, width, height)}
; } render() { @@ -73,7 +73,7 @@ export class GaugePanel extends PureComponent { const value = stat !== 'name' ? series.stats[stat] : series.label; return ( -
+
{this.renderGauge(value, vizWidth, vizHeight)}
);