Incubator-echarts: 按照地图javascript引入示例操作出现问题

Created on 20 Sep 2016  ·  1Comment  ·  Source: apache/incubator-echarts

echarts.min.js:25 Uncaught TypeError: Cannot read property 'nodeName' of null

按照地图javascript引入示例操作出现问题,不知道是哪里出现错误了
下面是代码

<!doctype html>
<html lang="zh-Hans">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <base target="_blank" />
    <title>地图</title>
    <meta name="keywords" content="">
    <meta name="Description" content="">
    <script src="js/echarts.min.js"></script>
    <script src="js/china.js"></script>
    <style>
        #main{width: 800px;height: 600px;}
    </style>
    <script>
    var chart = echarts.init(document.getElementById('main'));
        chart.setOption({
            series: [{
                type: 'map',
                map: 'china'
            }]
        });
    </script>
</head>
<body>
<div id="main"></div>
</body>
</html>

Most helpful comment

init 的时候还无法获取 main 这个 dom

>All comments

init 的时候还无法获取 main 这个 dom

Was this page helpful?
0 / 5 - 0 ratings