theFrontEndDev
theFrontEndDev

Reputation: 973

Vuejs : Error while mapping values of chart - TypeError: Cannot read property 'map' of undefined

I'am using vue-apexharts to render chart, chart data comes from an api.

              this.statistics = response.data;
              this.statistics.consent.map((consent) => {
                this.series.push(consent.count);
              });

But an error is shown - TypeError: Cannot read property 'map' of undefined

Upvotes: 0

Views: 1250

Answers (1)

JohnDoe_Scientist
JohnDoe_Scientist

Reputation: 670

Somehow when the map() function want to be executed, the this.statistics.consent is empty/null/undefined. try to debug it by console.log(this.statistics.consent). Hope that helps and good luck!

Upvotes: 1

Related Questions