question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant Use BoxPlot, Uncaught TypeError: Cannot read property 'chartLayout' of undefined

See original GitHub issue

One-line summary [问题简述]

When trying to use boxplot i encounter this error. Stacktrace and options pasted below. This behaviour is not present in v3.5.4

I have recently update to latest version and facing this error when trying use box plot

I have tried

  1. Using layout in series as horizontal
  2. As vertical
  3. As Null

@100pah

Uncaught TypeError: Cannot read property ‘chartLayout’ of undefined at WhiskerBox.webpackJsonpac__name_…/node_modules/echarts/lib/chart/helper/WhiskerBoxDraw.js.whiskerBoxProto.createContent (WhiskerBoxDraw.js:71) at new WhiskerBox (WhiskerBoxDraw.js:56) at DataDiffer.add (WhiskerBoxDraw.js:166) at DataDiffer.execute (DataDiffer.js:94) at WhiskerBoxDraw.webpackJsonpac__name…/node_modules/echarts/lib/chart/helper/WhiskerBoxDraw.js.whiskerBoxDrawProto.updateData (WhiskerBoxDraw.js:196) at ExtendedClass.render (whiskerBoxCommon.js:108) at ECharts.<anonymous> (echarts.js:1254) at ExtendedClass.<anonymous> (Global.js:499) at Array.forEach (<anonymous>) at each (util.js:263) at ExtendedClass.eachSeries (Global.js:497) at ECharts.doRender (echarts.js:1251) at ECharts.update (echarts.js:685) at ECharts.prepareAndUpdate (echarts.js:805) at ECharts.webpackJsonpac__name…/node_modules/echarts/lib/echarts.js.echartsProto._onframe (echarts.js:219) at Animation.trigger (Eventful.js:157) at Animation._update (Animation.js:156) at step (Animation.js:173) at ZoneDelegate.ac_polyfills…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424) at Zone.ac_polyfills…/node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:191) at ZoneTask.invoke (zone.js:486) at timer (zone.js:1540)

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.6.2
  • Browser version [浏览器类型和版本]: Chromium 60.0.3112
  • OS Version [操作系统类型和版本]: Ubuntu 16.04

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option ={
  "xAxis": {
    "type": "category",
    "name": "Time",
    "position": "bottom",
    "data": [
      "00:00",
      "01:00",
      "02:00",
      "03:00",
      "04:00",
      "05:00",
      "06:00",
      "07:00",
      "08:00",
      "09:00",
      "10:00",
      "11:00",
      "12:00",
      "13:00",
      "14:00",
      "15:00",
      "16:00",
      "17:00",
      "18:00",
      "19:00",
      "20:00",
      "21:00",
      "22:00",
      "23:00"
    ],
    "axisTick": {
      "alignWithLabel": true
    }
  },
  "yAxis": {
    "name": "Celsius",
    "type": "value",
    "scale": true,
    "nameLocation": "middle",
    "nameRotate": 90,
    "nameGap": 20
  },
  "tooltip": {
    "show": true
  },
  "grid": {
    "height": "50%"
  },
  "toolbox": {
    "orient": "horizontal",
    "show": true,
    "itemGap": 17,
    "feature": {
      "dataView": {
        "show": true,
        "title": "Data View",
        "lang": [
          "Data",
          "Close",
          "Refresh"
        ],
        "readOnly": true
      },
      "restore": {
        "show": true,
        "title": "Reset"
      },
      "saveAsImage": {
        "show": true,
        "title": "Download PNG"
      },
      "dataZoom": {
        "show": true,
        "yAxisIndex": "none",
        "title": {
          "zoom": "Zoom",
          "back": "Restore"
        }
      }
    }
  },
  "dataZoom": [
    {
      "type": "inside",
      "disabled": false
    },
    {
      "type": "slider"
    }
  ],
  "legend": {
    "data": [
      "04/01/2017"
    ],
    "top": "70%",
    "itemWidth": 10,
    "textStyle": {
      "fontSize": 11,
      "fontWeight": "lighter"
    },
    "tooltip": {
      "show": true
    },
    "show": true
  },
  "series": [
    {
      "type": "boxplot",
      "data": [
        {
          "name": "00:00",
          "value": [
            2.59,
            5.73,
            7.29,
            9.8,
            30.31
          ]
        },
        {
          "name": "01:00",
          "value": [
            2.07,
            5.41,
            6.83,
            8.51,
            14.74
          ]
        },
        {
          "name": "02:00",
          "value": [
            1.68,
            5.51,
            6.8,
            8.79,
            15.35
          ]
        },
        {
          "name": "03:00",
          "value": [
            2.33,
            5.51,
            6.8,
            8.53,
            15.9
          ]
        },
        {
          "name": "04:00",
          "value": [
            3.52,
            5.51,
            6.84,
            8.71,
            16.38
          ]
        },
        {
          "name": "05:00",
          "value": [
            4.76,
            6.47,
            7.94,
            9.82,
            18.6
          ]
        },
        {
          "name": "06:00",
          "value": [
            3.76,
            7.37,
            9.27,
            11.28,
            17.31
          ]
        },
        {
          "name": "07:00",
          "value": [
            0,
            6.78,
            9.45,
            12.28,
            17.95
          ]
        },
        {
          "name": "08:00",
          "value": [
            4.06,
            7.57,
            10.89,
            13.1,
            19.94
          ]
        },
        {
          "name": "09:00",
          "value": [
            3.58,
            8.42,
            12.27,
            15.67,
            22.21
          ]
        },
        {
          "name": "10:00",
          "value": [
            3.88,
            8.3,
            12.43,
            15.71,
            21.64
          ]
        },
        {
          "name": "11:00",
          "value": [
            -6.23,
            8.69,
            11.21,
            13.5,
            21.37
          ]
        },
        {
          "name": "12:00",
          "value": [
            3.34,
            7.57,
            10.79,
            12.66,
            18.56
          ]
        },
        {
          "name": "13:00",
          "value": [
            2.95,
            6.37,
            9,
            10.87,
            23.07
          ]
        },
        {
          "name": "14:00",
          "value": [
            1.7,
            6.05,
            7.09,
            10.16,
            14.75
          ]
        },
        {
          "name": "15:00",
          "value": [
            3.48,
            5.88,
            6.97,
            9.72,
            18.7
          ]
        },
        {
          "name": "16:00",
          "value": [
            3.68,
            7.65,
            9.98,
            11.89,
            21.87
          ]
        },
        {
          "name": "17:00",
          "value": [
            0,
            7.04,
            9.94,
            11.87,
            21.57
          ]
        },
        {
          "name": "18:00",
          "value": [
            3.79,
            7.43,
            10.82,
            12.87,
            20.99
          ]
        },
        {
          "name": "19:00",
          "value": [
            4.01,
            7.5,
            11.09,
            13.82,
            20.69
          ]
        },
        {
          "name": "20:00",
          "value": [
            0,
            7.29,
            11.03,
            14.3,
            21.52
          ]
        },
        {
          "name": "21:00",
          "value": [
            0.69,
            7.23,
            11.42,
            14.94,
            22.72
          ]
        },
        {
          "name": "22:00",
          "value": [
            3.38,
            6.93,
            10.54,
            13.04,
            20.73
          ]
        },
        {
          "name": "23:00",
          "value": [
            2.73,
            6.67,
            8.62,
            10.46,
            15.86
          ]
        }
      ],
      "name": "04/01/2017",
      "smooth": true,
      "connectNulls": true,
      "tooltip": {},
      "layout": "vertical"
    }
  ],
  "title": {
    "show": false
  },
  "color": [
    "#c23531",
    "#2f4554",
    "#61a0a8",
    "#d48265",
    "#91c7ae",
    "#749f83",
    "#ca8622",
    "#bda29a",
    "#6e7074",
    "#546570",
    "#c4ccd3"
  ]
}

Other comments [其他信息]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jonavilacommented, Aug 24, 2017

@piyushgupta1 @akansal1 As a workaround, you have to make sure the first item of the value array contains the index of the data item.

// value should be an array that contains: [index, min, q1, median, q3, max]
{
  value: [0, 1003, 12103, 27003, 42003, 56021]
}
0reactions
stale[bot]commented, Apr 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cant Use BoxPlot, Uncaught TypeError: Cannot read property ...
Using layout in series as horizontal; As vertical; As Null. @100pah. Uncaught TypeError: Cannot read property 'chartLayout' of undefined
Read more >
TypeError: Cannot read property 'map' of undefined...even ...
5 | const dataPointValues = props.dataPoints.map(dataPoint => dataPoint.value);. Here's the code to all three: ExpensesChart.js: import Chart ...
Read more >
Box chart (box plot) - MATLAB boxchart - MathWorks
This MATLAB function creates a box chart, or box plot, for each column of the matrix ... Use b to set properties of...
Read more >
Cannot read properties of undefined' - JavaScript Debugging
How To Fix ' Uncaught TypeError : Cannot read properties of undefined ' ... Do you make music and want to let me...
Read more >
ERROR TypeError: Cannot read property title of undefined
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found