Browse Source

Fix targets is undefined in hasType - #618

pull/647/head
Masayuki Tanaka 10 years ago
parent
commit
ecb2f3296d
  1. 2
      c3.js
  2. 2
      c3.min.js
  3. 2
      src/type.js

2
c3.js

@ -3146,7 +3146,7 @@
c3_chart_internal_fn.hasType = function (type, targets) {
var $$ = this, types = $$.config.data_types, has = false;
targets = targets || $$.data.targets;
if (targets.length) {
if (targets && targets.length) {
targets.forEach(function (target) {
var t = types[target.id];
if ((t && t.indexOf(type) >= 0) || (!t && type === 'line')) {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/type.js

@ -11,7 +11,7 @@ c3_chart_internal_fn.setTargetType = function (targetIds, type) {
c3_chart_internal_fn.hasType = function (type, targets) {
var $$ = this, types = $$.config.data_types, has = false;
targets = targets || $$.data.targets;
if (targets.length) {
if (targets && targets.length) {
targets.forEach(function (target) {
var t = types[target.id];
if ((t && t.indexOf(type) >= 0) || (!t && type === 'line')) {

Loading…
Cancel
Save