Browse Source

`getXValue` fails when x is 0

`getXValue` returns the index when x is specifically 0, because it's falsey. Fixed that by checking the specific case.
I have not updated c3.min.js.
pull/300/head
Quim Llimona 11 years ago
parent
commit
4206f9d6fe
  1. 2
      c3.js

2
c3.js

@ -1403,7 +1403,7 @@
return xValues;
}
function getXValue(id, i) {
return id in c3.data.xs && c3.data.xs[id] && c3.data.xs[id][i] ? c3.data.xs[id][i] : i;
return id in c3.data.xs && c3.data.xs[id] && (c3.data.xs[id][i] || c3.data.xs[id][i] === 0) ? c3.data.xs[id][i] : i;
}
function getOtherTargetXs() {
var idsForX = Object.keys(c3.data.xs);

Loading…
Cancel
Save