Apexcharts.js: TypeError: Cannot read property 'ToString' of undefined when bar chart is rendering with data.

Created on 10 Sep 2020  路  8Comments  路  Source: apexcharts/apexcharts.js

Codepen: https://codepen.io/jfalter/pen/rNedKOw

Whenever I attempt to render a bar chart with data, I get the following error message:

Uncaught (in promise) TypeError: Cannot read property 'toString' of undefined
at Function.value (apexcharts:6
at t.value (apexcharts:6)
at t.value (apexcharts:6)
at t.value (apexcharts:14)
at t.create (apexcharts:6)
at apexcharts:14
at new Promise (<anonymous>)
at t.value (apexcharts:14)
at apexcharts:6
at Array.forEach (<anonymous>)

When I look at the Apexcharts Javascript file, I see this throwing an error:

key: "escapeString",
value: function(t) {
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "x"
, i = t.toString().slice(); //This is what's throwing the error.
return i = i.replace(/[` ~!@#$%^&*()_|+-=?;:'",.<>{}[]\/]/gi, e)
}

Note that it works fine if I render with empty data and category arrays.

Most helpful comment

I have the same error! I thought that I was the only one.

All 8 comments

I have the same error! I thought that I was the only one.

Thanks for reporting.
It's a major bug and I had to immediately release a patch version as this might have broken many existing charts.

Please upgrade to v3.20.2

Works now! Thanks!

Thanks.it's working.

Upgraded to v3.20.2
Still showing
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined

@MohammadMerhi Can you create a Codepen?

Had this error when trying to add undefined value to label.
Label has to be a string.

occuring same problem of undefined.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pribilinskiy picture pribilinskiy  路  3Comments

jeroenpol picture jeroenpol  路  3Comments

EroTiXx picture EroTiXx  路  3Comments

rcoundon picture rcoundon  路  3Comments

drummad picture drummad  路  3Comments