Gauge: Fix display name showing for only single series (#26617)

This commit is contained in:
Torkel Ödegaard 2020-07-27 20:26:22 +02:00 committed by GitHub
parent cc0a8464ff
commit ff6919173a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
valueProps: VizRepeaterRenderValueProps<FieldDisplay, DisplayValueAlignmentFactors>,
menuProps: DataLinksContextMenuApi
): JSX.Element => {
const { options } = this.props;
const { options, fieldConfig } = this.props;
const { value, alignmentFactors, orientation, width, height, count } = valueProps;
const { field, display, view, colIndex } = value;
const { openMenu, targetClassName } = menuProps;
@ -33,7 +33,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
return (
<BarGauge
value={clearNameForSingleSeries(count, field, display)}
value={clearNameForSingleSeries(count, fieldConfig.defaults, display)}
width={width}
height={height}
orientation={orientation}

View File

@ -12,14 +12,14 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
valueProps: VizRepeaterRenderValueProps<FieldDisplay>,
menuProps: DataLinksContextMenuApi
): JSX.Element => {
const { options } = this.props;
const { options, fieldConfig } = this.props;
const { width, height, count, value } = valueProps;
const { field, display } = value;
const { openMenu, targetClassName } = menuProps;
return (
<Gauge
value={clearNameForSingleSeries(count, field, display)}
value={clearNameForSingleSeries(count, fieldConfig.defaults, display)}
width={width}
height={height}
field={field}