mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
minor touch ups
This commit is contained in:
parent
2fc136e615
commit
8c5c953521
@ -175,7 +175,7 @@ export class Gauge extends PureComponent<Props> {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
height: `${height * 0.9}px`,
|
||||
height: `${Math.min(height, width * 1.3)}px`,
|
||||
width: `${Math.min(width, height * 1.3)}px`,
|
||||
top: '10px',
|
||||
margin: 'auto',
|
||||
|
@ -43,12 +43,12 @@ export class VizRepeater extends PureComponent<Props> {
|
||||
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;
|
||||
}
|
||||
|
@ -45,14 +45,14 @@ export class GaugePanel extends PureComponent<Props> {
|
||||
const { options, width, height } = this.props;
|
||||
const value = timeSeries[0].stats[options.valueOptions.stat];
|
||||
|
||||
return <div className="singlestat-panel">{this.renderGauge(value, width, height)}</div>;
|
||||
return <div style={{ display: 'flex' }}>{this.renderGauge(value, width, height)}</div>;
|
||||
}
|
||||
|
||||
renderGaugeWithTableData(panelData) {
|
||||
const { width, height } = this.props;
|
||||
const firstTableDataValue = panelData.tableData.rows[0].find(prop => prop > 0);
|
||||
|
||||
return <div className="singlestat-panel">{this.renderGauge(firstTableDataValue, width, height)}</div>;
|
||||
return <div style={{ display: 'flex' }}>{this.renderGauge(firstTableDataValue, width, height)}</div>;
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -73,7 +73,7 @@ export class GaugePanel extends PureComponent<Props> {
|
||||
const value = stat !== 'name' ? series.stats[stat] : series.label;
|
||||
|
||||
return (
|
||||
<div className="singlestat-panel" key={`${series.label}-${index}`} style={vizContainerStyle}>
|
||||
<div key={`${series.label}-${index}`} style={Object.assign(vizContainerStyle, { display: 'flex' })}>
|
||||
{this.renderGauge(value, vizWidth, vizHeight)}
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user