apache / echarts

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

Multiple tooltips with different trigger type #11115

Open dileepyelleti opened 5 years ago

dileepyelleti commented 5 years ago

What problem does this feature solve?

For my line chart I need to show two types of tooltips. One on hover on exact point(like with trigger item) and another on hovering any other place (like trigger axis). Below issue was raised for same but closed without proper response https://github.com/apache/incubator-echarts/issues/4905

What does the proposed API look like?

tooltip: [{
        trigger: 'axis',
        formatter: axisTooltipFormatter
      },{
        trigger: 'item',
        formatter: itemTooltipFormatter
      }]

Or

{
  tooltip: {
     trigger: 'axis',
     formatter: axisTooltipFormatter
  },
  series[{
     ...
     tooltip: {
        formatter: itemTooltipFormatter // item trigger
    }
  ]
echarts-bot[bot] commented 5 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 you have posted enough image to demo your request. 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 .

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

Have a nice day! ๐Ÿต

yufeng04 commented 5 years ago

It is not currently supported.

Ovilia commented 5 years ago

Hi. Multiple-tooltip is a feature we wish to implement in v5.0, which is a long term requirement. You may need to wait for some time before you can use this feature.

rahulcyadav commented 4 years ago

@Ovilia could you answer this question for me https://stackoverflow.com/questions/60001739/formatting-axis-value-in-tooltip-for-trigger-item

zl7261 commented 4 years ago

I want to show the item's data when the trigger on bar.stack[i].item, and show total analysis when trigger the part between the bar height to chart height.

Currently, the tooltip.formatter function has 3 parameters,

But I can't identify the trigger is from the axis or item in the tooltip.formatter function.

Obviously, the axis and the item trigger should have different behavior in a series-bar chart.

Does this is not supported in Echarts' latest version? ้—ฎ้ข˜

anoosurf commented 4 years ago

image

a simple 'split' option to split the tooltip for each individual series.. is very helpful when analyzing multiple line charts

Darshan-agent commented 3 years ago

@anoosurf can you give code snippet how you splits option

anoosurf commented 3 years ago

the above pic is from highcharts .. i was suggesting echarts should have an option like this for easy contextual tooltip

Darshan-agent commented 3 years ago

@anoosurf oh okay my Bad tooltip item trigger won't trigger all the plots :(

Darshan-agent commented 3 years ago

Guys any Idea about below issue image

DavidFucsko commented 3 years ago

Why is this closed exactly?

image

a simple 'split' option to split the tooltip for each individual series.. is very helpful when analyzing multiple line charts

This would be a nice feature

Joaveinz commented 2 years ago

Hi. Multiple-tooltip is a feature we wish to implement in v5.0, which is a long term requirement. You may need to wait for some time before you can use this feature.

Hello @Ovilia, I see the version is now 5.2.2, has this been implemented? Or has the roadmap changed?

ddx32 commented 2 years ago

Hi, we're looking for this feature in our team as well. Is there any update on it in v5?

MarceloDiazz commented 2 years ago

hello @Ovilia , do you have any idea if this feature was applied ?

MarceloDiazz commented 2 years ago

I have a problem, this tooltip does not show all the values โ€‹โ€‹and they are below the div image

MarceloDiazz commented 2 years ago

for some strange reason the style of the tooltip sends top with a negative number and it stays below the div image

MarceloDiazz commented 2 years ago

image

MarceloDiazz commented 2 years ago

If anyone knows how I can edit that div to prevent it from doing that, If anyone knows how I can edit that div to prevent it from doing that, try extraCssText:"top:0 !important" but it doesn't work

image

rapomon commented 6 months ago

You can try to toggle the trigger between axis/item on mouseover/out over the series, something like this:

https://echarts.apache.org/examples/en/editor.html?c=multiple-y-axis&code=CYQwLiCMAEC80G0C0AWAbAGmkgrABiyUgOgCYBmUrUnTaAdjXq0nNqxVKukrtLxJoUWcuQC6AbgBQoCKTiJukAHR1yy8iI0iszMtSwl1w6CbSSZ4EOQUJl92SFIWpAWwCWAOwAiV-fABZcAALZQ9PAAp7ZUdSAEppVxAAD185BSCwUKTkqIc_BKkpAAcAUwAnAGNSzwgAc1KAJRBPBoUctKdsaHDO0mk3LwA1EAAbAFdSjJCwrzyYq0hCnJGJqcCZnPnHJYHYhViwkGKIiIA3McnuL2BS5Li4AD5oAG8paGhy0rBx8s9oc6XUryABUPRSq0mDwA9ODUn5pABfQqDTyQ4HTLKz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ZOm50v8ETFPz35SttvI13XDfKG9YBrjSE8RA-kfK7HzIaiK4qQaUrjlWecqPdAEmeFKbKlMoOV1C3bfjB3ZwVL39NSgRYqFMiAxuFrvXcojdm6t3bqUE6CFXif37n7C2Q95TQFHp4ce9Iloz1cHPZii9gGN1XuvJyW9Tw72jirR8B9OqtkimfTS_9eTX1viaB-lIn7gNfpA8YYBYEMx_n_FEuDl5gJfm_LuWAe50zgYPQOw9kFjychg8os954YSAcvAhG9m7b1ZFHGOmUBRCkPq2Y-p8qYX3Jowu-LC2EiMge_cakjeGQF_kiFEgCl4gKbpEdhHcuHdx4fAo23IYBIJQWgye08lFYJUT0NRniNFEO0UrMhe9EqGKoRKWitDzEMPpEw--j9n4QKgQEwOLjK4JCAA&lang=ts

LiiKaz commented 5 months ago

@rapomon This is a really good alternative. It allows me to configure different item formatters according to the series, and to keep the default tooltip for axis (just adding { replaceMerge: 'tooltip' } in mouseout setOption).

Thanks !