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

旭日图可否分层设置nodeClick属性 #7541

Open
candy4290 opened this Issue Jan 19, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@candy4290
Copy link

candy4290 commented Jan 19, 2018

One-line summary [问题简述]

我希望点击旭日图最外层时,跳转,也就是设置nodeClick: 'link'。但这时候点别的层时,就不会下钻了。
可否有办法,让我只有最外层点击时不是下钻,别的层点击时是下钻。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.0.0
  • Browser version [浏览器类型和版本]: 谷歌63.0.3239.132(正式版本) (64 位)
  • OS Version [操作系统类型和版本]: window7

Expected behaviour [期望结果]

旭日图,只有最外层点击时是跳转,别的层点击时是下钻

ECharts option [ECharts配置项]

option = {
				title: {
					text: '旭日图',
					textStyle: {
						fontStyle: 'italic',
						fontWeight: 'bold',
						fontSize: 14
					},
				},
				series: {
					type: 'sunburst',
					highlightPolicy: 'ancestor',
					data: this.data,
					radius: [0, '95%'],
					sort: null,
					levels: [{}, {
						r0: '15%',
						r: '35%',
						itemStyle: {
							borderWidth: 2
						},
						label: {
							rotate: 'tangential'
						}
					}, {
						r0: '35%',
						r: '70%',
						nodeClick: 'link',
						label: {
							align: 'right'
						}
					}, {
						r0: '70%',
						r: '72%',
						label: {
							position: 'outside',
							padding: 5,
							silent: false,
							color: 'black'
						},
						itemStyle: {
							borderWidth: 3
						}
					}]
				}
			};

Other comments [其他信息]

image

@candy4290

This comment has been minimized.

Copy link
Author

candy4290 commented Jan 22, 2018

换个说法,旭日图可以设置最外面一层点击后无法下钻,别的层点击后,下钻么

@Ovilia

This comment has been minimized.

Copy link
Contributor

Ovilia commented Jan 22, 2018

@candy4290 后面我会支持一下这个功能

@candy4290

This comment has been minimized.

Copy link
Author

candy4290 commented Jan 22, 2018

@pissang 希望的就是设置下钻与点击后跳转。这两者是可以并存的。我可以设置旭日图内容为下钻,外层为点击事件。现在是如果设置可以点击跳转,整个图将无法下钻。这不是我想要的。然后希望有tooltip,如果我可以在tooltip里面添加link,进行跳转也可以。期待你们的下个版本,thank you

@Ovilia

This comment has been minimized.

Copy link
Contributor

Ovilia commented Jan 22, 2018

嗯嗯,明白了,可以新支持按层,或者对每个扇形块单独设置链接还是下钻的功能。

@candy4290

This comment has been minimized.

Copy link
Author

candy4290 commented Jan 23, 2018

@Ovilia 是的,就是希望有这样的功能,目前项目先把这段代码注释了-。-,期待你们的新功能,thank you

@Ovilia Ovilia closed this in c7d935b Jan 23, 2018

@candy4290

This comment has been minimized.

Copy link
Author

candy4290 commented Mar 9, 2018

原来希望的功能在4.0.4中已经有了。但我发现了个问题,我设置了target: 'self',当我第一次点这个地方时,跳转了,但是跳转到了一个新的页面上。在新的页面中,我返回该旭日图并点击上次的地方,现在是在原页面上跳转,没问题。 只有第一次打开页面时,点击,会跳转到一个新的页面上!!!这是什么原因呢,大神 @Ovilia

@Ovilia

This comment has been minimized.

Copy link
Contributor

Ovilia commented Mar 9, 2018

诶,我检查下

@Ovilia Ovilia reopened this Mar 9, 2018

@Ovilia Ovilia self-assigned this Sep 6, 2018

@Ovilia Ovilia added the pending label Sep 6, 2018

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