Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLasitsa authored Apr 8, 2021
1 parent 032825c commit f4ddeb7
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,27 +283,25 @@ function MetricsAxisOptions(props: ValidationVisOptionsProps<VisParams>) {
const updatedSeries = metrics.map((agg) => {
const params = stateParams.seriesParams.find((param) => param.data.id === agg.id);
const label = agg.makeLabel();
let series: SeriesParam;

// update labels for existing params or create new one
if (params) {
series = {
return {
...params,
data: {
...params.data,
label,
},
};
} else {
series = makeSerie(
const series = makeSerie(
agg.id,
label,
firstValueAxesId,
stateParams.seriesParams[stateParams.seriesParams.length - 1]
);
return series;
}

return series;
});

setValue('seriesParams', updatedSeries);
Expand Down

0 comments on commit f4ddeb7

Please sign in to comment.