Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

series-map label 只在高亮的情况下显示 #10893

Closed
ziyouren opened this issue Jul 22, 2019 · 15 comments
Closed

series-map label 只在高亮的情况下显示 #10893

ziyouren opened this issue Jul 22, 2019 · 15 comments

Comments

@ziyouren
Copy link

Version

4.2.1

Reproduction link

https://gallery.echartsjs.com/editor.html?c=xOnQGOKTSK&comment=0

Steps to reproduce

series 里的label 如果只在高亮的时候显示,请问怎么设置呢,我把label设置为false,emphasis设置true,就都不显示了。

What is expected?

实现只高亮的区域显示label

What is actually happening?

不知道怎么设置

@echarts-bot
Copy link

echarts-bot bot commented Jul 22, 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! 🍵

@echarts-bot echarts-bot bot added bug pending We are not sure about whether this is a bug/new feature. waiting-for-help labels Jul 22, 2019
@susiwen8
Copy link
Contributor

没能复现,你引用了map/js/world.js了吗?

@susiwen8 susiwen8 removed pending We are not sure about whether this is a bug/new feature. waiting-for-help labels Jul 22, 2019
@ziyouren
Copy link
Author

没能复现,你引用了map/js/world.js了吗?

https://www.echartsjs.com/gallery/editor.html?c=doc-example/map-visualMap-continuous
您可以在这个示例地址把代码复制过去看下。
就是44行改下label的show 看下效果。(true的情况是都显示,false是都不显示)
label:{show:true}, label:{show:false}
我想只显示china的label

option = { title : { text: 'World Population (2010)', subtext: 'from United Nations, Total population, both sexes combined, as of 1 July (thousands)', sublink : 'http://esa.un.org/wpp/Excel-Data/population.htm', left: 'center', top: 'top' }, tooltip : { trigger: 'item', formatter : function (params) { var value = (params.value + '').split('.'); value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + '.' + value[1]; return params.seriesName + '<br/>' + params.name + ' : ' + value; } }, toolbox: { show : true, orient : 'vertical', left: 'right', top: 'center', feature : { mark : {show: true}, dataView : {show: true, readOnly: false}, restore : {show: true}, saveAsImage : {show: true} } }, visualMap: { type: 'continuous', min: 0, max: 1000000, text:['High','Low'], realtime: false, calculable : true, color: ['orangered','yellow','lightskyblue'] }, series : [ { name: 'World Population (2010)', type: 'map', mapType: 'world', label:{show:true}, emphasis:{ label:{show:true} }, roam: true, itemStyle:{ emphasis:{label:{show:true}} }, data:[ {name : 'China', value : 17150.76} ] } ] }

@susiwen8
Copy link
Contributor

susiwen8 commented Jul 22, 2019

Screen Shot 2019-07-22 at 17 46 26

Screen Shot 2019-07-22 at 17 47 12

上图是true,下图是false

@ziyouren
Copy link
Author

上图是true,下图是false

抱歉,可能我没表达清楚,就是我现在china是高亮选中状态,我想让他默认显示China这个label,不是鼠标移上显示。

@ziyouren
Copy link
Author

抱歉,我重新写了一个列子:
https://gallery.echartsjs.com/editor.html?c=xMCWqDcsIa&v=4
现在我主要是想实现,地图选中的区域,默认一种颜色,鼠标移上是另一种颜色,同时选中的区域默认显示区域名称。

@susiwen8
Copy link
Contributor

OK,明白你的意思了

@susiwen8
Copy link
Contributor

susiwen8 commented Jul 23, 2019

去掉geo,series这样设置
series: [{
name: 'categoryA',
type: 'map',
mapType: 'china',
geoIndex: 0,
// tooltip: {show: false},
label: {
normal: {
show: false
},
emphasis: {
show: true
}
},
data: [{
name: '山东',
value: 0,
label: {
show: true,
}
},
{
name: '北京',
value: 100
}
]
}]

@ziyouren
Copy link
Author

能不删除geo的情况下实现吗?我的geo还有自定义的地图设置

@ziyouren
Copy link
Author

我这里面还有散点的展示,也有用到geo的坐标系

@susiwen8
Copy link
Contributor

Screen Shot 2019-07-23 at 11 37 53

好像不行

@deyihu
Copy link

deyihu commented Jul 23, 2019

@ziyouren

https://gallery.echartsjs.com/editor.html?c=xMCWqDcsIa&v=6

不知是不是你想要的效果

@ziyouren
Copy link
Author

@ziyouren

https://gallery.echartsjs.com/editor.html?c=xMCWqDcsIa&v=6

不知是不是你想要的效果

哈哈,对对,就是这个效果。
可以不用geo的,这几天搞了好几个地图,搞晕了,谢谢。

@ziyouren
Copy link
Author

Screen Shot 2019-07-23 at 11 37 53

@susiwen8 感谢及时回复

@deyihu 感谢

@vskcat
Copy link

vskcat commented Sep 28, 2020

上面的效果是不能缩放的,想要实现缩放就会发现其实是两张地图叠在一起,能不能一张地图上实现?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants