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

如何禁用图例的点击事件 #204

Closed
wxhwan opened this issue May 10, 2024 · 8 comments
Closed

如何禁用图例的点击事件 #204

wxhwan opened this issue May 10, 2024 · 8 comments
Labels
duplicate This issue or pull request already exists helpful

Comments

@wxhwan
Copy link

wxhwan commented May 10, 2024

不想要图表下边的图例的点击事件,请问如何禁用呢

@AAChartModel
Copy link
Owner

AAChartModel commented May 10, 2024

参考 Swift 版本的相同问题:

Kotlin 版本的禁用图例的点击事件做法与之类似.

@wxhwan
Copy link
Author

wxhwan commented May 10, 2024 via email

@AAChartModel
Copy link
Owner

饼图禁用图例点击事件的方式稍微特殊一点, 参考:

@AAChartModel AAChartModel added the duplicate This issue or pull request already exists label May 10, 2024
@wxhwan
Copy link
Author

wxhwan commented May 10, 2024

但是我用的是java版本的,是这么写吗
aaOptions.plotOptions.series.events = new AASeriesEvents().legendItemClick("false");

@AAChartModel
Copy link
Owner

Java 版本的写法:

        //禁用图例点击事件
        aaOptions.plotOptions.series.events = new AASeriesEvents()
                .legendItemClick("function() { " +
                        "return false; " +
                        "}");

demo 中有相关示例, 下载运行查看即可.

@wxhwan
Copy link
Author

wxhwan commented May 10, 2024

点击了之后看起来是不会隐藏折线了,但是折线的颜色变浅了

@AAChartModel
Copy link
Owner

这个应该是 Highcharts 刻意的默认效果, 参考:

@AAChartModel
Copy link
Owner

AAChartModel commented May 10, 2024

点击了之后看起来是不会隐藏折线了,但是折线的颜色变浅了

参考 Swift 版本的相同问题:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists helpful
Projects
None yet
Development

No branches or pull requests

2 participants