Skip to content

地图名称标签位置设置无效 #10824

@chengwb53

Description

@chengwb53

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?

标签位置没变化

Activity

echarts-bot

echarts-bot commented on Jul 9, 2019

@echarts-bot

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

Ovilia commented on Jul 10, 2019

@Ovilia
Contributor

你的代码有问题,labelitemStyle 应该是同级的。
不过好像 position 的确没用生效。

added and removed
pendingWe are not sure about whether this is a bug/new feature.
on Jul 10, 2019
shelbeniskb

shelbeniskb commented on Aug 13, 2019

@shelbeniskb

position 没生效的问题还没解决吗?

added this to the 4.5.0 milestone on Sep 6, 2019
removed this from the 4.5.0 milestone on Sep 23, 2019
chengwb53

chengwb53 commented on Sep 23, 2019

@chengwb53
Author

你的代码有问题,labelitemStyle 应该是同级的。
不过好像 position 的确没用生效。

3.4.0版本不是同级

added this to the TBD milestone on Sep 24, 2019
pissang

pissang commented on Mar 19, 2020

@pissang
Contributor

地图的标签位置是不能设置的,固定显示在行政区域的位置。不太清楚需要设置 position: 'left' 的场景是什么

screamsyk

screamsyk commented on Jun 29, 2020

@screamsyk

当地图区块形状不规则时,常常需要把地图标签定位到区块比较主体的部分,这就需要用到了

chengwb53

chengwb53 commented on Aug 6, 2020

@chengwb53
Author

地图的标签位置是不能设置的,固定显示在行政区域的位置。不太清楚需要设置 position: 'left' 的场景是什么

image

excellnn

excellnn commented on Sep 30, 2020

@excellnn

请问,这个问题解决了没有啊

andelio

andelio commented on Jan 4, 2022

@andelio

麻烦有空维护一下这个问题

lishuli

lishuli commented on Apr 14, 2023

@lishuli

I have the same problem

screamsyk

screamsyk commented on Apr 14, 2023

@screamsyk
helgasoft

helgasoft commented on Jan 22, 2024

@helgasoft

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

image

screamsyk

screamsyk commented on Jan 22, 2024

@screamsyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Ovilia@pissang@excellnn@shelbeniskb@helgasoft

        Issue actions

          地图名称标签位置设置无效 · Issue #10824 · apache/echarts