diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-20 15:09:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-20 15:09:02 +0300 |
commit | 98252e0dd60cbcb316231085e206d9872f243b8a (patch) | |
tree | 304021f4190aabcc74f1359866c0efff84995729 /app/assets/javascripts/vue_shared/components | |
parent | 2ee5991b42717969af93cb30d863aafab04dff8a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/bar_chart.vue | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_shared/components/bar_chart.vue b/app/assets/javascripts/vue_shared/components/bar_chart.vue index ff718eacc5b..25d7bfe515c 100644 --- a/app/assets/javascripts/vue_shared/components/bar_chart.vue +++ b/app/assets/javascripts/vue_shared/components/bar_chart.vue @@ -124,7 +124,9 @@ export default { }, }, mounted() { - this.draw(); + if (!this.allValuesEmpty) { + this.draw(); + } }, methods: { draw() { @@ -151,14 +153,7 @@ export default { this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]); this.xScale.domain(this.graphData.map(d => d.name)); - /* - If we have all-zero graph we want graph to center 0 on axis and not to draw - any kind of ticks on Y axis. Infinity allows us to do that. - - See https://gitlab.com/gitlab-org/gitlab/merge_requests/20627#note_251484582 - for detailed explanation - */ - this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]); + this.yScale.domain([0, d3.max(this.graphData.map(d => d.value))]); // Zoom/Panning Function this.zoom = d3 |