Incubator-echarts: Uncaught Error: series.type should be specified.

Created on 10 May 2018  ·  2Comments  ·  Source: apache/incubator-echarts

One-line summary [问题简述]

动态设置setOption,其中series部分报错,Uncaught Error: series.type should be specified.

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:4版本,3版本
  • Browser version [浏览器类型和版本]:chrome
  • OS Version [操作系统类型和版本]:mac

Expected behaviour [期望结果]

在线等解决,目前通过循环后台的数据动态生成series,setOption时报错。

ECharts option [ECharts配置项]


//blackMap是后台传回来的Map<String, List<String>>
option = {
color: ['#48cda6', '#11abff', '#968ade', '#33316b', '#AA2C98', '#d15b47', '#58829e'],
                            legend: {
                                data: blackSiteNames
                            },
                            xAxis: {
                                data: blackTimes
                            },
                            series: function () {
                                var series = [];
                                for (var key in blackMap) {
                                    var item = {
                                        name: key,
                                        line: true,
                                        smooth: true,
                                        data: blackMap[key]
                                    }
                                    series.push(item);
                                }
                                return series;
                            }()
                        }
}

Other comments [其他信息]


image

stale

Most helpful comment

你这个问题完全是伸手党,不自己排查问题。
这个不是Issue啊,
你的series的type属性没有设置。 提示的问题也告诉了,series的type要指定。
var item = {
type: 'line' || 'bar' .............
...
}

All 2 comments

你这个问题完全是伸手党,不自己排查问题。
这个不是Issue啊,
你的series的type属性没有设置。 提示的问题也告诉了,series的type要指定。
var item = {
type: 'line' || 'bar' .............
...
}

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zendic picture Zendic  ·  3Comments

akvaliya picture akvaliya  ·  3Comments

antorman picture antorman  ·  3Comments

kirazxyun picture kirazxyun  ·  3Comments

hanhui picture hanhui  ·  3Comments