flipped series and when keys

This commit is contained in:
Jose Ivan Vargas 2017-09-07 18:26:33 -05:00
parent 7f5ae2e8b2
commit 4bd5c062f0

View file

@ -68,8 +68,8 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
.y1(d => timeSeriesScaleY(d.value));
const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]];
const seriesCustomizationData = queryData.when != null &&
_.findWhere(queryData.when[0].series,
const seriesCustomizationData = queryData.series != null &&
_.findWhere(queryData.series[0].when,
{ value: timeSeriesMetricLabel });
if (seriesCustomizationData != null) {
metricTag = seriesCustomizationData.value || timeSeriesMetricLabel;