Skip to content

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

@JCFalter

Description

@JCFalter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions