Skip to content

Cannot read property 'count' of undefined #8870

@ghost

Description

One-line summary [问题简述]

从服务器获取数据异步加载的时候出现错误
Uploading image.png…

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:"echarts": "^4.1.0",
  • Browser version [浏览器类型和版本]:chrome 最新版
  • OS Version [操作系统类型和版本]:

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option = {
getOption = () => {
            return {
                title: {
                    text: '一周概况',
                },
                tooltip: {
                    trigger: 'axis',
                },
                legend: {
                    
                },
                // dataset: {
                //     // 提供一份数据。
                //     source: [
                //         ['product', ...weekday],
                //         ['注册用户数量', ...forCountInArr(data.users)],
                //         ['Milk Tea', 83.1, 73.4, 55.1],
                //         ['Cheese Cocoa', 86.4, 65.2, 82.5],
                //         ['Walnut Brownie', 72.4, 53.9, 39.1]
                //     ]
                // },

                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: weekday
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        formatter: `{value}`
                    }
                },
                series: [
                    {
                       
                        type: 'line',
                        data: this.asyncData(data.users),
                        color: 'green',
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ],
                        },
                    },
                    {
                        name: '入住商家数量',
                        type: 'line',
                        data: this.asyncData(data.business),
                        color: 'yellow',
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ],
                        },
                    },
                    {
                     
                        type: 'line',
                        color: '#008573',
                        data: this.asyncData(data.propertyMngCos),
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ],
                        },
                    },
                    {
                        
                        type: 'line',
                        data: this.asyncData(data.communities),
                        color: '#7CFC00',
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ],
                        },
                    },
                    {
                        name: '订单数量',
                        type: 'line',
                        data: this.asyncData(data.orders),
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ],
                        },
                    }
                ]
            };
        }
}

Other comments [其他信息]

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