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

如果获取雷达图当前点的值或者索引? #15339

Closed
YIngChenIt opened this issue Jul 13, 2021 · 4 comments
Closed

如果获取雷达图当前点的值或者索引? #15339

YIngChenIt opened this issue Jul 13, 2021 · 4 comments

Comments

@YIngChenIt
Copy link

Version

4.3.0

Steps to reproduce

option = { title: { text: '基础雷达图' }, legend: { data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)'] }, radar: { // shape: 'circle', indicator: [ { name: '销售(Sales)', max: 6500}, { name: '管理(Administration)', max: 16000}, { name: '信息技术(Information Technology)', max: 30000}, { name: '客服(Customer Support)', max: 38000}, { name: '研发(Development)', max: 52000}, { name: '市场(Marketing)', max: 25000} ] }, series: [{ name: '预算 vs 开销(Budget vs spending)', type: 'radar', data: [ { value: [4200, 3000, 20000, 35000, 50000, 18000], name: '预算分配(Allocated Budget)' }, { value: [5000, 14000, 28000, 26000, 42000, 21000], name: '实际开销(Actual Spending)' } ] }] };

我想获取当前点的索引或者值,而不是全部,配置如代码,我想点击到销售点上,只想获取销售的索引或者当前值,看了好久的文档,没有找到,有谁知道的么?
我用了点击事件,发现里面有个参数是dataIndex,但是永远是0

有什么办法可以让我拿到点击销售这个点对应的索引或者数据么

What is expected?

获取雷达图当前点的值或者索引

What is actually happening?

点击事件拿的是全部事件,获取不到当前点的数据

@echarts-bot
Copy link

echarts-bot bot commented Jul 13, 2021

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 it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

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: community labels Jul 13, 2021
@echarts-bot
Copy link

echarts-bot bot commented Jul 13, 2021

@YIngChenIt It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

What if I get the value or index of the current point of the radar map?

BODY

Version

4.3.0

Steps to reproduce

option = { title: { text:'Basic radar chart' }, legend: { data: ['Allocated Budget','Actual Spending'] }, radar: { // shape:'circle', indicator: [ {name:'Sales (Sales)', max: 6500}, {name:'Administration', max: 16000}, {name:'Information Technology (Information Technology)', max: 30000}, {name:'Customer Support', max: 38000}, {name:'Development (Development)', max: 52000}, {name:'Marketing (Marketing)', max: 25000} ] }, series: [{ name:'Budget vs spending (Budget vs spending)', type:'radar', data: [ { value: [4200, 3000, 20000, 35000, 50000, 18000], name:'Allocated Budget' }, { value: [5000, 14000, 28000, 26000, 42000, 21000], name:'Actual Spending' } ] }] };

I want to get the index or value of the current point, but not all. The configuration is like the code. I want to click on the point of sale. I only want to get the index or current value of the sale. I read the document for a long time, but I didn’t find it. Does anyone know? ?
I used the click event and found that there is a parameter dataIndex, but it is always 0

Is there any way I can get the index or data corresponding to the point of click sales?

What is expected?

Get the value or index of the current point on the radar chart

What is actually happening?

Click the event to get all the events, the current point data cannot be obtained

@Ovilia
Copy link
Contributor

Ovilia commented Jul 20, 2021

请关注 #10750

@Ovilia Ovilia added duplicate and removed bug pending We are not sure about whether this is a bug/new feature. labels Jul 20, 2021
@Ovilia Ovilia closed this as completed Jul 20, 2021
@helgasoft
Copy link

yes, a bug in tooltip.formatter data for radar.
The tooltip.formatter handler for radar gives incorrect data.dataIndex and data.seriesIndex.
Demo Code

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

No branches or pull requests

3 participants