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 ...@@ -65,9 +65,9 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]]; const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]];
const seriesCustomizationData = query.series != null && const seriesCustomizationData = query.series != null &&
_.findWhere(query.series[0].when, _.findWhere(query.series[0].when, { value: timeSeriesMetricLabel });
{ value: timeSeriesMetricLabel });
if (seriesCustomizationData != null) { if (seriesCustomizationData) {
metricTag = seriesCustomizationData.value || timeSeriesMetricLabel; metricTag = seriesCustomizationData.value || timeSeriesMetricLabel;
[lineColor, areaColor] = pickColor(seriesCustomizationData.color); [lineColor, areaColor] = pickColor(seriesCustomizationData.color);
} else { } else {
...@@ -75,6 +75,10 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV ...@@ -75,6 +75,10 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV
[lineColor, areaColor] = pickColor(); [lineColor, areaColor] = pickColor();
} }
if (query.track) {
metricTag += ` - track: ${query.track}`;
}
return { return {
linePath: lineFunction(timeSeries.values), linePath: lineFunction(timeSeries.values),
areaPath: areaFunction(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