Browse Source

Fix y domain padding when label shown - #317

pull/333/head
Masayuki Tanaka 11 years ago
parent
commit
08fc91a637
  1. 6
      c3.js
  2. 4
      c3.min.js

6
c3.js

@ -1234,6 +1234,12 @@
isAllPositive = yDomainMin >= 0 && yDomainMax >= 0;
isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;
// Bar/Area chart should be 0-based if all positive|negative
if (hasBarType(yTargets) || hasAreaType(yTargets)) {
if (isAllPositive) { yDomainMin = 0; }
if (isAllNegative) { yDomainMax = 0; }
}
domainLength = Math.abs(yDomainMax - yDomainMin);
padding = padding_top = padding_bottom = domainLength * 0.1;

4
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save