From 5f54f2dc000fb49bd71af28845dce6060dcc0df9 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Mon, 19 Apr 2021 17:45:10 -0700 Subject: [PATCH] GraphNG: flip logic so we can explicitly say the field types to keep (#33140) --- packages/grafana-ui/src/components/GraphNG/GraphNG.tsx | 2 +- packages/grafana-ui/src/components/uPlot/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx index 55476d5cbe1..ed005c1b484 100755 --- a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx +++ b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx @@ -96,7 +96,7 @@ class UnthemedGraphNG extends React.Component { return { ...state, - data: preparePlotData(frame, [FieldType.string]), + data: preparePlotData(frame, [FieldType.number]), alignedDataFrame: frame, seriesToDataFrameFieldIndexMap: frame.fields.map((f) => f.state!.origin!), dimFields, diff --git a/packages/grafana-ui/src/components/uPlot/utils.ts b/packages/grafana-ui/src/components/uPlot/utils.ts index d1ff8fbbf0f..e4658e64e49 100755 --- a/packages/grafana-ui/src/components/uPlot/utils.ts +++ b/packages/grafana-ui/src/components/uPlot/utils.ts @@ -35,7 +35,7 @@ export function buildPlotConfig(props: PlotProps, plugins: Record = new Map(); let seriesIndex = 0; @@ -57,7 +57,7 @@ export function preparePlotData(frame: DataFrame, ignoreFieldTypes?: FieldType[] seriesIndex++; continue; } - if (ignoreFieldTypes && ignoreFieldTypes.indexOf(f.type) > -1) { + if (keepFieldTypes && keepFieldTypes.indexOf(f.type) < 0) { continue; } collectStackingGroups(f, stackingGroups, seriesIndex);