请求各ECharts做的省份地图的小问题 怎么显示市区名称

shiorol 2017-06-08 10:54:05
这是前端代码

<script src="${ctx}/static/js/page.js" type="text/javascript"></script>
<script src="${ctx}/static/echarts/map/china.js"></script>
<script type="text/javascript" src="${ctx}/static/echarts/map/sichuan.js"></script>

<script type="text/javascript">

//省份地图
var proMap = echarts.init(document.getElementById('proMap'));
proMap.resize();
proOption = {
backgroundColor:"#fff",
title: {
// text : '北京市国家试点示范项目分布',
x:'center',
y:'2%',
textStyle:{
fontSize: 15,
fontWeight: 'bolder',
}
},
tooltip : {
trigger: 'item',
formatter: function(param){return '项目名称:'+ param.value[2]}
},
geo: {
map: '四川',
label: {
emphasis: {
show: true
}
} ,
roam:true,
itemStyle: {
normal: {
areaColor: '#45c8ff',
borderColor: '#fff'
},
emphasis: {
areaColor: '#00aeee'
}
}
},
series : [
{
name:'',
type: 'scatter',
coordinateSystem: 'geo',
selectedMode : 'single',
itemStyle:{
normal: {
color: '#ffe65d',
shadowBlur: 3,
shadowColor: '#fff'
},
},
roam:true,
data:function(){
return eval('${proMaplist}');
}()

}
]
};
proMap.setOption(proOption);
...全文
6399 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
手触苍穹 2019-01-18
  • 打赏
  • 举报
回复 1
geo:{ map: map, label: { normal: { //静态的时候展示样式 show: true, //是否显示地图省份得名称 textStyle: { color: "#fff", fontSize: 12, fontFamily: "Arial" } }, }, roam: true, itemStyle: { normal : { borderColor : '#E6E6E6', borderWidth : 0.8, areaColor :'#2cacf7', } }, regions: [{ name: '韶关市', itemStyle: { normal: { areaColor: 'red', color: 'red' } } }] },
手触苍穹 2019-01-18
  • 打赏
  • 举报
回复
map: map, label: { normal: { //静态的时候展示样式 show: true, //是否显示地图省份得名称 textStyle: { color: "#fff", fontSize: 12, fontFamily: "Arial" } }, tooltip : { // 鼠标移动到线条上的提示 show : true, trigger : 'item', formatter : function (params,ticket,callback){ debugger; var dd="dad" } }, }, roam: true, itemStyle: { normal : { borderColor : '#E6E6E6', borderWidth : 0.8, areaColor :'#2cacf7', } }, regions: [{ name: '韶关市', itemStyle: { normal: { areaColor: 'red', color: 'red' } } }]
「已注销」 2017-07-13
  • 打赏
  • 举报
回复
我找到了,就是这个.
zy_arhahaha 2017-06-08
  • 打赏
  • 举报
回复
去echarts官网查api,,
shiorol 2017-06-08
  • 打赏
  • 举报
回复
只有鼠标放上去才显示
shiorol 2017-06-08
  • 打赏
  • 举报
回复
不显示市区名称
shiorol 2017-06-08
  • 打赏
  • 举报
回复
官网没找到.

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧