echarts中的option.legend.data has not been defined.
2015-07-24 23:33
771 查看
1、错误描述
2、错误原因
3、解决办法
legend : {
show:true
},
2、错误原因
var map = function(mapData){ require( [ 'echarts', 'echarts/chart/map' ], function (ec) { var mapChart = ec.init(document.getElementById('mapDataChart')); var option = { title : { text: '', x : 'center', y : 'top' }, tooltip : { trigger: 'item', formatter: '{a}<br/>{b}:{c}个' }, legend : { show:true }, dataRange: { min: 0, max: 1000, calculable : true }, series : [ { name: '', type: 'map', mapType: 'china', data:mapData, showLegendSymbol:true } ], animation: true }; // 为echarts对象加载数据 mapChart .setOption(option); }); }由于echarts中的map没有legend属性,导致报错
3、解决办法
var map = function(mapData){ require( [ 'echarts', 'echarts/chart/map' ], function (ec) { var mapChart = ec.init(document.getElementById('mapDataChart')); var option = { title : { text: '', x : 'center', y : 'top' }, tooltip : { trigger: 'item', formatter: '{a}<br/>{b}:{c}个' }, dataRange: { min: 0, max: 1000, calculable : true }, series : [ { name: '', type: 'map', mapType: 'china', data:mapData, showLegendSymbol:true } ], animation: true }; // 为echarts对象加载数据 mapChart .setOption(option); }); }去掉
legend : {
show:true
},
相关文章推荐
- 禁止视频网站使用Flash P2P上传
- linux rsync远程同步(续)
- Linux下软件安装
- Linux下进程的内存结构
- 基于Linux的智能家居的设计(3)
- log4j.properties配置详解
- shell数组使用
- Nginx+Keepalived
- 1.[WP Developer体验Andriod开发]之Andriod布局 VS WinPhone布局
- 将nginx配置成url_hash转发方式
- shell脚本:shell的基本元素-4 华丽的printf输出
- Install OpenCV3.0 on Ubuntu(linaro)12.04 in ARM
- Openssl crl命令
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日
- 重生的自己,仅此纪念2013年7月25日