Echarts的显示效果问题

XXLyangzai 发布于 2014/04/17 10:03
阅读 899
收藏 0

你好!@Kener-林峰

option = {

backgroundColor: '#1b1b1b',
color: ['gold','aqua','lime'],
title : {
text: '',
subtext:'',
x:'center',
textStyle : {
color: '#fff'
}
},
tooltip : {
trigger: 'item',
formatter: function(v) {
return v[1].replace(':', ' > ');
}
},
dataRange: {
min : 0,
max : 34,
precision : 1 ,
calculable : false,
color: ['red','orange','yellow','lightgreen'],
textStyle:{
color:'#fff'
}
},
series : [
{
name: '全国',
type: 'map',
roam: false,
hoverable: false,
mapType: 'china',
itemStyle:{
normal:{
borderColor:'rgba(100,149,237,1)',
borderWidth:0.5,
areaStyle:{
color: '#1b1b1b'
}
}
},
data:[],
markLine : {
smooth:true,
symbol: ['none', 'circle'],
symbolSize : 1,
itemStyle : {
normal: {
color:'#fff',
borderWidth:1,
borderColor:'rgba(30,144,255,0.5)'
}
},
data : [
[{name:'广州市'},{name:'北京市'}]
,
[{name:'广州市'},{name:'上海市'}]
,
[{name:'广州市'},{name:'武汉市'}]
,
[{name:'广州市'},{name:'深圳市'}]
,
[{name:'广州市'},{name:'长沙市'}]
,
[{name:'广州市'},{name:'南京市'}]
,
[{name:'广州市'},{name:'苏州市'}]
,
[{name:'广州市'},{name:'哈尔滨市'}]
,
[{name:'广州市'},{name:'成都市'}]
,
[{name:'广州市'},{name:'沈阳市'}]
,
[{name:'广州市'},{name:'天津市'}]
,
[{name:'广州市'},{name:'杭州市'}]
,
[{name:'广州市'},{name:'重庆市'}]
,
[{name:'广州市'},{name:'宁波市'}]
,
[{name:'广州市'},{name:'青岛市'}]
,
[{name:'广州市'},{name:'厦门市'}]
,
[{name:'广州市'},{name:'无锡市'}]
,
[{name:'广州市'},{name:'郑州市'}]
,
[{name:'广州市'},{name:'东莞市'}]
,
[{name:'广州市'},{name:'福州市'}]
,
[{name:'广州市'},{name:'烟台市'}]
,
[{name:'广州市'},{name:'合肥市'}]
,
[{name:'广州市'},{name:'大连市'}]
,
[{name:'广州市'},{name:'台州市'}]
,
[{name:'广州市'},{name:'西安市'}]
,
[{name:'广州市'},{name:'昆明市'}]
,
[{name:'广州市'},{name:'南宁市'}]
,
[{name:'广州市'},{name:'乌鲁木齐市'}]
],
},
geoCoord: {
'广州市': [113.2700,23.1300]
,'北京市': [116.4551,40.2539]
,'上海市': [121.4700,31.2300]
,'武汉市': [114.3000,30.6000]
,'深圳市': [114.0500,22.5500]
,'长沙市': [112.9300,28.2300]
,'南京市': [118.7800,32.0700]
,'苏州市': [120.5800,31.3000]
,'哈尔滨市': [126.5300,45.8000]
,'成都市': [104.0700,30.6700]
,'沈阳市': [123.4300,41.8000]
,'天津市': [117.4219,39.4189]
,'杭州市': [120.1500,30.2800]
,'重庆市': [106.5500,29.5700]
,'宁波市': [121.5500,29.8800]
,'青岛市': [120.3800,36.0700]
,'厦门市': [118.0800,24.4800]
,'无锡市': [120.3000,31.5700]
,'郑州市': [113.6200,34.7500]
,'东莞市': [113.7500,23.0500]
,'福州市': [119.300,26.0800]
,'烟台市': [121.4300,37.4500]
,'合肥市': [117.2500,31.8300]
,'大连市': [121.6200,38.9200]
,'台州市': [121.4300,28.6800]
,'西安市': [108.9300,34.2700]
,'昆明市': [102.7200,25.0500]
,'南宁市': [108.3700,22.8200]
,'乌鲁木齐市': [87.6200,43.8200]
}
},
{
name: '广州市',
type: 'map',
mapType: 'china',
data:[],
markLine : {
smooth:true,
effect : {
show: true,
size: 3,
shadowColor: 'yellow'
},
itemStyle : {
normal: {
borderWidth:1
}
},
data : [
[{name:'广州市'}, {name:'北京市',value:31}]
, [{name:'广州市'}, {name:'上海市',value:31}]
, [{name:'广州市'}, {name:'武汉市',value:22}]
, [{name:'广州市'}, {name:'深圳市',value:21}]
, [{name:'广州市'}, {name:'长沙市',value:17}]
, [{name:'广州市'}, {name:'南京市',value:17}]
, [{name:'广州市'}, {name:'苏州市',value:17}]
, [{name:'广州市'}, {name:'哈尔滨市',value:16}]
, [{name:'广州市'}, {name:'成都市',value:16}]
, [{name:'广州市'}, {name:'沈阳市',value:16}]
, [{name:'广州市'}, {name:'天津市',value:15}]
, [{name:'广州市'}, {name:'杭州市',value:15}]
, [{name:'广州市'}, {name:'重庆市',value:12}]
, [{name:'广州市'}, {name:'宁波市',value:12}]
, [{name:'广州市'}, {name:'青岛市',value:12}]
, [{name:'广州市'}, {name:'厦门市',value:12}]
, [{name:'广州市'}, {name:'无锡市',value:11}]
, [{name:'广州市'}, {name:'郑州市',value:10}]
, [{name:'广州市'}, {name:'东莞市',value:10}]
, [{name:'广州市'}, {name:'福州市',value:10}]
, [{name:'广州市'}, {name:'烟台市',value:9}]
, [{name:'广州市'}, {name:'合肥市',value:9}]
, [{name:'广州市'}, {name:'大连市',value:9}]
, [{name:'广州市'}, {name:'台州市',value:8}]
, [{name:'广州市'}, {name:'西安市',value:8}]
, [{name:'广州市'}, {name:'昆明市',value:8}]
, [{name:'广州市'}, {name:'南宁市',value:8}]
, [{name:'广州市'}, {name:'乌鲁木齐市',value:7}]
]
}
}
]
};
myChart.setOption(option);
}
); 


我用这个方法加载的地图报表,可是有的报表能显示,有的报表不能显示。。。

奇怪的是在Echarts官网就能正常显示,是我加载的方式错了吗

加载中
0
Kener-林峰
Kener-林峰

跟引入方式没关系,调试一下你的代码,setOption前都把option打印出来看看那里的数据有问题。

另外你的config里没配置map的路径啊

XXLyangzai
XXLyangzai
哦,谢谢~我再调试调试
0
XXLyangzai
XXLyangzai

貌似就广州市的会出问题~郁闷死~

0
Kener-林峰
Kener-林峰

说啥呢?问题是什么?

XXLyangzai
XXLyangzai
呃,就是偶尔报表里面动画效果没法显示,报length的错,我在想是不是引入方式有问题
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部