Commit 580eff07 authored by Illya Klymov's avatar Illya Klymov

Fix corner case when chart has no data

parent eabebd9a
...@@ -124,9 +124,7 @@ export default { ...@@ -124,9 +124,7 @@ export default {
}, },
}, },
mounted() { mounted() {
if (!this.allValuesEmpty) { this.draw();
this.draw();
}
}, },
methods: { methods: {
draw() { draw() {
...@@ -153,7 +151,7 @@ export default { ...@@ -153,7 +151,7 @@ export default {
this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]); this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]);
this.xScale.domain(this.graphData.map(d => d.name)); this.xScale.domain(this.graphData.map(d => d.name));
this.yScale.domain([0, d3.max(this.graphData.map(d => d.value))]); this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]);
// Zoom/Panning Function // Zoom/Panning Function
this.zoom = d3 this.zoom = d3
......
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