Incubator-echarts: 旭日图可否分层设置nodeClick属性

Created on 19 Jan 2018  ·  8Comments  ·  Source: apache/incubator-echarts

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

enhancement pending stale

Most helpful comment

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

All 8 comments

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

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

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

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

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

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

诶,我检查下

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings