Merge branch 'gauge-multi-series' of github.com:grafana/grafana into gauge-multi-series
This commit is contained in:
@@ -17,6 +17,7 @@ interface Props extends PanelProps<GaugeOptions> {}
|
||||
export class GaugePanel extends PureComponent<Props> {
|
||||
renderMultipleGauge(timeSeries) {
|
||||
const { options, height, width } = this.props;
|
||||
const { stat } = options;
|
||||
|
||||
return timeSeries.map((series, index) => {
|
||||
const singleStatWidth = 1 / timeSeries.length * 100;
|
||||
@@ -48,9 +49,11 @@ export class GaugePanel extends PureComponent<Props> {
|
||||
gaugeHeight = repeatingGaugeHeight;
|
||||
}
|
||||
|
||||
const value = stat !== 'name' ? series.stats[stat] : series.label;
|
||||
|
||||
return (
|
||||
<div className="singlestat-panel" key={`${timeSeries.label}-${index}`} style={style}>
|
||||
{this.renderGauge(series.stats[options.stat], gaugeWidth, gaugeHeight)}
|
||||
{this.renderGauge(value, gaugeWidth, gaugeHeight)}
|
||||
<div style={{ textAlign: 'center' }}>{series.label}</div>
|
||||
</div>
|
||||
);
|
||||
@@ -77,12 +80,9 @@ export class GaugePanel extends PureComponent<Props> {
|
||||
|
||||
renderSingleGauge(timeSeries) {
|
||||
const { options, width, height } = this.props;
|
||||
const value = timeSeries[0].stats[options.stat];
|
||||
|
||||
return (
|
||||
<div className="singlestat-panel">
|
||||
{this.renderGauge(timeSeries[0].stats[options.stat], width, height)}
|
||||
</div>
|
||||
);
|
||||
return <div className="singlestat-panel">{this.renderGauge(value, width, height)}</div>;
|
||||
}
|
||||
|
||||
renderGaugeWithTableData(panelData) {
|
||||
|
||||
Reference in New Issue
Block a user