Commit dab26c55 authored by Mike Greiling's avatar Mike Greiling

correctly handle empty array passed to setData

parent 1a230346
......@@ -64,8 +64,8 @@ export default class BurndownChart {
})).sort((a, b) => (a.date - b.date));
// adjust axis domain to correspond with data
this.xMax = Math.max(d3.max(this.data, d => d.date), this.dueDate);
this.yMax = Math.max(d3.max(this.data, d => d.value), 1);
this.xMax = Math.max(d3.max(this.data, d => d.date) || 0, this.dueDate);
this.yMax = d3.max(this.data, d => d.value) || 1;
this.xScale.domain([this.startDate, this.xMax]);
this.yScale.domain([0, this.yMax]);
......
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