Skip to content

Commit

Permalink
revert: prevent stage and run query to apply legends (#4816)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored Apr 4, 2024
1 parent af353b9 commit b480ff1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions frontend/src/lib/uPlotLib/utils/getSeriesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const getSeries = ({
widgetMetaData,
graphsVisibilityStates,
panelType,
currentQuery,
}: GetSeriesProps): uPlot.Options['series'] => {
const configurations: uPlot.Series[] = [
{ label: 'Timestamp', stroke: 'purple' },
Expand All @@ -42,15 +41,13 @@ const getSeries = ({
const newGraphVisibilityStates = graphsVisibilityStates?.slice(1);

for (let i = 0; i < seriesList?.length; i += 1) {
const { metric = {}, queryName = '', legend: lgd } = widgetMetaData[i] || {};
const { metric = {}, queryName = '', legend = '' } = widgetMetaData[i] || {};

const newLegend =
currentQuery?.builder.queryData.find((item) => item.queryName === queryName)
?.legend || '';

const legend = newLegend || lgd || '';

const label = getLabelName(metric, queryName || '', legend);
const label = getLabelName(
metric,
queryName || '', // query
legend || '',
);

const color = generateColor(label, themeColors.chartcolors);

Expand Down

0 comments on commit b480ff1

Please sign in to comment.