Commit 5af31d6e authored by Mike Greiling's avatar Mike Greiling

add track information to data legend

parent 1f7ecf9a
......@@ -65,9 +65,9 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]];
const seriesCustomizationData = query.series != null &&
_.findWhere(query.series[0].when,
{ value: timeSeriesMetricLabel });
if (seriesCustomizationData != null) {
_.findWhere(query.series[0].when, { value: timeSeriesMetricLabel });
if (seriesCustomizationData) {
metricTag = seriesCustomizationData.value || timeSeriesMetricLabel;
[lineColor, areaColor] = pickColor(seriesCustomizationData.color);
} else {
......@@ -75,6 +75,10 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
[lineColor, areaColor] = pickColor();
}
if (query.track) {
metricTag += ` - track: ${query.track}`;
}
return {
linePath: lineFunction(timeSeries.values),
areaPath: areaFunction(timeSeries.values),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment