Browse Source

fixes errors on null data

fixes errors thrown when provided with null array e.g.
['data',null,null]
pull/488/head
michalkop93 10 years ago
parent
commit
cc794c66a3
  1. 6
      c3.js
  2. 4
      c3.min.js

6
c3.js

@ -1250,6 +1250,12 @@
if (yTargets.length === 0) { // use current domain if target of axisId is none if (yTargets.length === 0) { // use current domain if target of axisId is none
return axisId === 'y2' ? y2.domain() : y.domain(); return axisId === 'y2' ? y2.domain() : y.domain();
} }
if (isNaN(yDomainMin)) { // set minimum to zero when not number
yDomainMin = 0;
}
if (isNaN(yDomainMax)) { // set maximum to have same value as yDomainMin
yDomainMax = yDomainMin;
}
if (yDomainMin === yDomainMax) { if (yDomainMin === yDomainMax) {
yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0; yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0;
} }

4
c3.min.js vendored

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