From e072a950381ff965bf51bb5d7431a03ed56ce5d5 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Fri, 25 Oct 2013 11:45:16 +0700 Subject: [PATCH] Fix 0 height bug --- c3.js | 3 ++- c3.min.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/c3.js b/c3.js index 2e5f727..7b3a49e 100644 --- a/c3.js +++ b/c3.js @@ -374,7 +374,8 @@ return __size_width === null ? getParentWidth() : __size_width; } function getCurrentHeight () { - return __size_height === null ? getParentHeight() : __size_height; + var h = __size_height === null ? getParentHeight() : __size_height; + return h > 0 ? h : 320; } function getParentWidth () { return +d3.select(__bindto).style("width").replace('px',''); // TODO: if rotated, use height diff --git a/c3.min.js b/c3.min.js index 2d58344..3f0bed2 100644 --- a/c3.min.js +++ b/c3.min.js @@ -3,8 +3,8 @@ B(0))/2;D=c?0:U;switch(p){case "bottom":A=k;ua.attr("y2",F);wa.attr("y",Math.max(F,0)+J);va.attr("x1",D).attr("x2",D).attr("y2",F);ba.attr("x",0).attr("y",Math.max(F,0)+J);O.attr("dy",".71em").style("text-anchor","middle");O.text(function(c){return n.length