apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.66k stars 19.61k forks source link

report a problem, that is the tooltip of type map. #14832

Closed DoubleCorner closed 3 years ago

DoubleCorner commented 3 years ago

Version

5.0.2

Steps to reproduce

option.tooltip = {
  trigger: 'item',
  confine: true,
  formatter: function () {
    const item = mapData[param.dataIndex];
      // TODO echarts 5 bug 会显示上次 tip
      // 没有数据则不展示 tooltip
      if (!item) return null;
  }

Tooltip will show last content. I hope is not displayed. tips: 4.9.0 is ok. image

What is expected?

return null will not display last tooltip

What is actually happening?

return null will display last tooltip

echarts-bot[bot] commented 3 years ago

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 dev@echarts.apache.org. 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! 🍵

pissang commented 3 years ago

I don't understand what do you mean by "show last content"

DoubleCorner commented 3 years ago

As shown in the picture, there is no data in Xinjiang. If there is no data, I will return null. But when the mouse hovers over it, it shows the data of Tibet. I was floating in Tibet before, and Tibet has data

pissang commented 3 years ago

But the screenshot shows Tibet is the highlighted area.

DoubleCorner commented 3 years ago

那是另一个问题。我用dispatchAction 触发 mapSelect 后,他高亮的颜色是黄色。但是鼠标触发的高亮颜色是那个灰色。而且我已经在 itemStyle 设置 emphasis 的 areaColor 了

pissang commented 3 years ago

@Rainy-Bear 发个可以复现的 demo 给我们吧

echarts-bot[bot] commented 3 years ago

@Rainy-Bear Please provide a minimum reproducible demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz.

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.

DoubleCorner commented 3 years ago

https://codesandbox.io/s/cocky-knuth-hd27z?file=/src/index.js

echarts-bot[bot] commented 3 years ago

This issue is labeled with priority: high, which means it's a frequently asked problem and we will fix it ASAP.

echarts-bot[bot] commented 3 years ago

This issue is labeled with difficulty: easy. @Rainy-Bear Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. 🤓

DoubleCorner commented 3 years ago

这个问题在 5.1.2 中修复了吗?