Incubator-echarts: echarts 与mobx整合数据无法展示

Created on 9 Aug 2017  ·  2Comments  ·  Source: apache/incubator-echarts

One-line summary [问题简述]

通过mobx设置option后,程序异常
Error: series.type should be specified.

Version & Environment [版本及环境]

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

Expected behaviour [期望结果]

ECharts option [ECharts配置项]


 @observable option = {
legend: {
                data:['昨天','今天']
            },
            xAxis: {
                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',
                ]
            },
            yAxis: {},
            series: [{
                name: '今天',
                type: 'bar',
                data: [1212,123123,312321]
            },{
                name: '昨天',
                type: 'bar',
                data: [122,23333,333,23,423423,42]
            }]
}

Other comments [其他信息]


All 2 comments

这个就是在第一次 setOption 的时候 series 没写 type 会报的错,你检查下

我用mobx的toJS方法转换了下就可以了,我试试你说的,谢谢哈

Was this page helpful?
0 / 5 - 0 ratings