diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-11-04 23:51:45 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-11-06 14:07:09 -0600 |
commit | b7273c10ea91c71c8d0eb1d9ecde7983839ffae7 (patch) | |
tree | eab44e0af0891697c8f5ffa54603557fa9c44c23 | |
parent | 045795d0d93dfe426cac668d612aa031114df930 (diff) | |
download | gitlab-ce-b7273c10ea91c71c8d0eb1d9ecde7983839ffae7.tar.gz |
fix bug in which axes are scaled only to first data set
-rw-r--r-- | app/assets/javascripts/monitoring/components/graph.vue | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/monitoring/components/graph.vue b/app/assets/javascripts/monitoring/components/graph.vue index 5aa3865f96a..d3174bceb08 100644 --- a/app/assets/javascripts/monitoring/components/graph.vue +++ b/app/assets/javascripts/monitoring/components/graph.vue @@ -153,8 +153,9 @@ const axisYScale = d3.scale.linear() .range([this.graphHeight - this.graphHeightOffset, 0]); - axisXScale.domain(d3.extent(this.timeSeries[0].values, d => d.time)); - axisYScale.domain([0, d3.max(this.timeSeries[0].values.map(d => d.value))]); + const allValues = this.timeSeries.reduce((all, { values }) => all.concat(values), []); + axisXScale.domain(d3.extent(allValues, d => d.time)); + axisYScale.domain([0, d3.max(allValues.map(d => d.value))]); const xAxis = d3.svg.axis() .scale(axisXScale) |