Commit 8b75e705 authored by DungSaga's avatar DungSaga

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

parent bc0b6db9
...@@ -6245,7 +6245,7 @@ ...@@ -6245,7 +6245,7 @@
}; };
c3_chart_fn.data.values = function (targetId) { c3_chart_fn.data.values = function (targetId) {
var target = this.data(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) { c3_chart_fn.data.names = function (names) {
return this.internal.updateDataAttributes('names', names); return this.internal.updateDataAttributes('names', names);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,7 +9,7 @@ c3_chart_fn.data.shown = function (targetId) { ...@@ -9,7 +9,7 @@ c3_chart_fn.data.shown = function (targetId) {
}; };
c3_chart_fn.data.values = function (targetId) { c3_chart_fn.data.values = function (targetId) {
var target = this.data(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) { c3_chart_fn.data.names = function (names) {
return this.internal.updateDataAttributes('names', names); return this.internal.updateDataAttributes('names', names);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment