Apexcharts.js: t[n].data.map is not a function

Created on 14 Feb 2020  路  2Comments  路  Source: apexcharts/apexcharts.js

Hey guys,

I'm receiving the following error when trying to render a chart, or updating one:

image

I think it's related to my data since when my server returns an empty array, there is no error on the console and the chart is drawn empty, as expected, but I couldn't find whats wrong...

I used this doc to build it: Doc

And I also made a pen to reproduce it: CodePen

Could you tell where I messed up, o maybe what I'm missing?

Thanks in advance!

Most helpful comment

Here is the correct way to define series data

var series = [
    {
      name: 'Luke Skywalker',
      data: [
        {
          x: 'Topico 1',
          y: 60
        }
      ]
    },
    {
      name: 'Rey Skywalker',
      data: [
        {
          x: 'Topico 1',
          y: 120
        }
      ]
    }
  ]

All 2 comments

Here is the correct way to define series data

var series = [
    {
      name: 'Luke Skywalker',
      data: [
        {
          x: 'Topico 1',
          y: 60
        }
      ]
    },
    {
      name: 'Rey Skywalker',
      data: [
        {
          x: 'Topico 1',
          y: 120
        }
      ]
    }
  ]

Oh! That was so obvious! I'm sorry for that :/

Anyway, thank you very much for pointing this out! :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rudeayelo picture rudeayelo  路  3Comments

pribilinskiy picture pribilinskiy  路  3Comments

ismaildervisoglu picture ismaildervisoglu  路  3Comments

tcarlsen picture tcarlsen  路  3Comments

EroTiXx picture EroTiXx  路  3Comments