diff --git a/packages/grafana-ui/src/components/GraphNG/utils.test.ts b/packages/grafana-ui/src/components/GraphNG/utils.test.ts index 31a4bb00209..23efa7a7726 100644 --- a/packages/grafana-ui/src/components/GraphNG/utils.test.ts +++ b/packages/grafana-ui/src/components/GraphNG/utils.test.ts @@ -499,7 +499,7 @@ describe('GraphNG utils', () => { ], }, ], - "length": 10, + "length": 12, } `); }); diff --git a/packages/grafana-ui/src/components/GraphNG/utils.ts b/packages/grafana-ui/src/components/GraphNG/utils.ts index 3abea36bb97..5d35a8e3926 100644 --- a/packages/grafana-ui/src/components/GraphNG/utils.ts +++ b/packages/grafana-ui/src/components/GraphNG/utils.ts @@ -13,7 +13,9 @@ import { nullToUndefThreshold } from './nullToUndefThreshold'; import { XYFieldMatchers } from './types'; function isVisibleBarField(f: Field) { - return f.config.custom?.drawStyle === GraphDrawStyle.Bars && !f.config.custom?.hideFrom?.viz; + return ( + f.type === FieldType.number && f.config.custom?.drawStyle === GraphDrawStyle.Bars && !f.config.custom?.hideFrom?.viz + ); } // will mutate the DataFrame's fields' values @@ -105,6 +107,8 @@ export function preparePlotFrame(frames: DataFrame[], dimFields: XYFieldMatchers vals.push(undefined, undefined); } }); + + alignedFrame.length += 2; } return alignedFrame;