Commit ff691917 by Torkel Ödegaard Committed by GitHub

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

parent cc0a8464
...@@ -21,7 +21,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> { ...@@ -21,7 +21,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
valueProps: VizRepeaterRenderValueProps<FieldDisplay, DisplayValueAlignmentFactors>, valueProps: VizRepeaterRenderValueProps<FieldDisplay, DisplayValueAlignmentFactors>,
menuProps: DataLinksContextMenuApi menuProps: DataLinksContextMenuApi
): JSX.Element => { ): JSX.Element => {
const { options } = this.props; const { options, fieldConfig } = this.props;
const { value, alignmentFactors, orientation, width, height, count } = valueProps; const { value, alignmentFactors, orientation, width, height, count } = valueProps;
const { field, display, view, colIndex } = value; const { field, display, view, colIndex } = value;
const { openMenu, targetClassName } = menuProps; const { openMenu, targetClassName } = menuProps;
...@@ -33,7 +33,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> { ...@@ -33,7 +33,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
return ( return (
<BarGauge <BarGauge
value={clearNameForSingleSeries(count, field, display)} value={clearNameForSingleSeries(count, fieldConfig.defaults, display)}
width={width} width={width}
height={height} height={height}
orientation={orientation} orientation={orientation}
......
...@@ -12,14 +12,14 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> { ...@@ -12,14 +12,14 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
valueProps: VizRepeaterRenderValueProps<FieldDisplay>, valueProps: VizRepeaterRenderValueProps<FieldDisplay>,
menuProps: DataLinksContextMenuApi menuProps: DataLinksContextMenuApi
): JSX.Element => { ): JSX.Element => {
const { options } = this.props; const { options, fieldConfig } = this.props;
const { width, height, count, value } = valueProps; const { width, height, count, value } = valueProps;
const { field, display } = value; const { field, display } = value;
const { openMenu, targetClassName } = menuProps; const { openMenu, targetClassName } = menuProps;
return ( return (
<Gauge <Gauge
value={clearNameForSingleSeries(count, field, display)} value={clearNameForSingleSeries(count, fieldConfig.defaults, display)}
width={width} width={width}
height={height} height={height}
field={field} field={field}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment