Line类型在react中使用时报错(createListFormArray.js:90 'get' of undefined) #2758

Closed
luofei2011 opened this Issue Mar 8, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@luofei2011

问题简述 (One-line summary)

echart3.1.2 在react使用中,type:'line'时报错createListFromArray.js:90 Uncaught TypeError: Cannot read property 'get' of undefined

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.1.2
  • 浏览器类型和版本 (Browser version):chrome 49
  • 操作系统类型和版本 (OS Version): windows8

重现步骤 (Steps to reproduce)

import echarts from 'echarts/lib/echarts';
import 'echarts/lib/chart/line';

期望结果 (Expected behaviour)

Line能正常展现

可能哪里有问题 (What went wrong)

需要的组件没有加载完?除了line还有别的?

ECharts配置项 (ECharts option)

option = {
 xAxis: {
        type: 'value',
        splitLine: {
            show: false
        }
    },
    yAxis: {
        type: 'value',
        splitLine: {
            show: false
        }
    },
    series: [{
        type: 'line',
        showSymbol: false,
        hoverAnimation: false,
        data: [[1,3],[2,4], [5,6],[9,100]]
    }]
}

其他信息 (Other comments)

@pissang

This comment has been minimized.

Show comment
Hide comment
@pissang

pissang Mar 8, 2016

Contributor

还需要引入 grid 组件

import 'echarts/lib/component/grid';
Contributor

pissang commented Mar 8, 2016

还需要引入 grid 组件

import 'echarts/lib/component/grid';

@pissang pissang closed this Mar 9, 2016

@luofei2011

This comment has been minimized.

Show comment
Hide comment
@luofei2011

luofei2011 Mar 22, 2016

@pissang
引入echarts/lib/component/grid之后,除了Line;其它的Map、Pie、Gauge都带了网格……设置grid: {show: false}也没用。

这个怎么破?

另外,map在react中使用,hover的时候特别卡。感觉是地图精度太高,计算过于复杂 ?(已解决)

componentDidMount() {
    $.getJSON('/assets/json/heilongjiang.json', function (geoJson) {
            echarts.registerMap('HLJ', geoJson);
            // setOption
    )}
}

@pissang
引入echarts/lib/component/grid之后,除了Line;其它的Map、Pie、Gauge都带了网格……设置grid: {show: false}也没用。

这个怎么破?

另外,map在react中使用,hover的时候特别卡。感觉是地图精度太高,计算过于复杂 ?(已解决)

componentDidMount() {
    $.getJSON('/assets/json/heilongjiang.json', function (geoJson) {
            echarts.registerMap('HLJ', geoJson);
            // setOption
    )}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment