Browse Source

fix error when trying to get values of a non-existant targetId

pull/736/head
DungSaga 10 years ago
parent
commit
8b75e705a0
  1. 2
      c3.js
  2. 4
      c3.min.js
  3. 2
      src/api.data.js

2
c3.js

@ -6245,7 +6245,7 @@
};
c3_chart_fn.data.values = function (targetId) {
var target = this.data(targetId);
return target ? target.values.map(function (d) { return d.value; }) : null;
return target[0] ? target[0].values.map(function (d) { return d.value; }) : null;
};
c3_chart_fn.data.names = function (names) {
return this.internal.updateDataAttributes('names', names);

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/api.data.js

@ -9,7 +9,7 @@ c3_chart_fn.data.shown = function (targetId) {
};
c3_chart_fn.data.values = function (targetId) {
var target = this.data(targetId);
return target ? target.values.map(function (d) { return d.value; }) : null;
return target[0] ? target[0].values.map(function (d) { return d.value; }) : null;
};
c3_chart_fn.data.names = function (names) {
return this.internal.updateDataAttributes('names', names);

Loading…
Cancel
Save