diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 00:07:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 00:07:39 +0300 |
commit | 74a89b1221eaf780374bd1d4c5b2ee4a0f488908 (patch) | |
tree | 27dbcfdbc4216e9bee04b9be9c974d86744d51ba /app/assets/javascripts/vue_shared/components | |
parent | b0abae12affecc466aeb10889e8a6c000d6f67f5 (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, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/bar_chart.vue b/app/assets/javascripts/vue_shared/components/bar_chart.vue index 25d7bfe515c..ff718eacc5b 100644 --- a/app/assets/javascripts/vue_shared/components/bar_chart.vue +++ b/app/assets/javascripts/vue_shared/components/bar_chart.vue @@ -124,9 +124,7 @@ export default { }, }, mounted() { - if (!this.allValuesEmpty) { - this.draw(); - } + this.draw(); }, methods: { draw() { @@ -153,7 +151,14 @@ export default { this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]); this.xScale.domain(this.graphData.map(d => d.name)); - this.yScale.domain([0, d3.max(this.graphData.map(d => d.value))]); + /* + 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]); // Zoom/Panning Function this.zoom = d3 |