From f34616bfad024af343cb66ed6171b31f7b5209fb Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Wed, 18 Mar 2015 16:09:27 +0700 Subject: [PATCH] Fix barchart height --- app/jsx/charts/bar_chart.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/jsx/charts/bar_chart.jsx b/app/jsx/charts/bar_chart.jsx index 9240eec..c8440b4 100644 --- a/app/jsx/charts/bar_chart.jsx +++ b/app/jsx/charts/bar_chart.jsx @@ -104,11 +104,6 @@ var BarChart = React.createClass({ }.bind(this)) .take(this.numElements) .value(); - for (var i = points.length; i < this.numElements; i++) { - var point = {}; - point[this.state.sort] = 0; - points.push(point); - } this.setState({ points: points, @@ -138,6 +133,13 @@ var BarChart = React.createClass({ : 'org'); subject = this.getParams()[target]; + var points = _.clone(this.state.points); + if (points.length > 0) { + for (var i = points.length; i < this.numElements; i++) { + points.push({commits: 0, delta: 0}); + } + } + return (
@@ -158,7 +160,7 @@ var BarChart = React.createClass({ - {this.state.points.map(this.renderBar)} + {points.map(this.renderBar)}
);