-
Notifications
You must be signed in to change notification settings - Fork 19.8k
Open
Milestone
Description
Version
3.4.0
Reproduction link
https://echarts.baidu.com/examples/editor.html?c=map-HK
Steps to reproduce
// 复制下列代码替换https://echarts.baidu.com/examples/editor.html?c=map-HK 中编辑区域原来的代码,添加了label的position为left
myChart.showLoading();
$.get('data/asset/geo/HK.json', function (geoJson) {
myChart.hideLoading();
echarts.registerMap('HK', geoJson);
myChart.setOption(option = {
title: {
text: '香港18区人口密度 (2011)',
subtext: '人口密度数据来自Wikipedia',
sublink: 'http://zh.wikipedia.org/wiki/%E9%A6%99%E6%B8%AF%E8%A1%8C%E6%94%BF%E5%8D%80%E5%8A%83#cite_note-12'
},
series: [
{
name: '香港18区人口密度',
type: 'map',
mapType: 'HK', // 自定义扩展图表类型
itemStyle:{
normal:{
label:{
show:true,
position: 'left' // 指定标签显示位置
}
},
emphasis:{label:{show:true}}
}
}
]
});
});
What is expected?
地区标签能显示在指定的位置
What is actually happening?
标签位置没变化
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
echarts-bot commentedon Jul 9, 2019
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.
Have a nice day! 🍵
Ovilia commentedon Jul 10, 2019
你的代码有问题,
label
和itemStyle
应该是同级的。不过好像
position
的确没用生效。shelbeniskb commentedon Aug 13, 2019
position 没生效的问题还没解决吗?
chengwb53 commentedon Sep 23, 2019
3.4.0版本不是同级
pissang commentedon Mar 19, 2020
地图的标签位置是不能设置的,固定显示在行政区域的位置。不太清楚需要设置 position: 'left' 的场景是什么
screamsyk commentedon Jun 29, 2020
当地图区块形状不规则时,常常需要把地图标签定位到区块比较主体的部分,这就需要用到了
chengwb53 commentedon Aug 6, 2020
excellnn commentedon Sep 30, 2020
请问,这个问题解决了没有啊
andelio commentedon Jan 4, 2022
麻烦有空维护一下这个问题
lishuli commentedon Apr 14, 2023
I have the same problem
screamsyk commentedon Apr 14, 2023
helgasoft commentedon Jan 22, 2024
Version 5.4.3 here.
label.position does not work, but label.offset does the same and it's even more precise. However both are applied to all labels.
@chengwb53 shows a problem of overlapping label of an embedded region which is a possible scenario.
In such case it's better to use label.formatter with rich and padding - Demo Code
screamsyk commentedon Jan 22, 2024