echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] The tooltip is not positioned correctly

Open MariiieP opened this issue 1 year ago • 7 comments

Version

5.5.1

Link to Minimal Reproduction

https://codesandbox.io/s/compassionate-lamport-6y7yc7?file=/src/App.js

Steps to Reproduce

create a tooltip that returns long series names

Current Behavior

the tooltip has poor positioning. the tooltip could fit if it was located below/above to the right/left of the place where it is located. 7 image

Expected Behavior

the tooltip has correct positioning

Environment

- OS: windows
- Browser: Chrome 126.0.6478.185
- Framework: React 18

Any additional comments?

No response

MariiieP avatar Aug 01 '24 13:08 MariiieP

use confine - Demo

🚩 Please follow Official posting guidelines (below). This is not a good place to ask questions about usage, "how to" or extensive debugging assistance.


The issue list is reserved exclusively for bug reports and feature requests. For usage questions, please use the following resources:


Another good resource is website makeapie.cn with many code examples.

helgasoft avatar Aug 01 '24 17:08 helgasoft

This is not the best solution. It it still works worse than highcharts. If you have a lot of series with titles or tree view and the graph is located under the header and so on, it is shifted from the upper border of the screen - this area is not used, although it could be. https://codesandbox.io/s/compassionate-lamport-6y7yc7?file=/src/App.js

image

it also worsens the performance of use. Navigation to the central points is almost impossible, because the tooltip does not move to the right/left

8 image

@helgasoft, The bug is still relevant

MariiieP avatar Aug 02 '24 07:08 MariiieP

hm, first we want to confine the tooltip, but make it as big as the chart so it becomes unusable. Then we want the giant tooltip to move to the side, i.e. to not be confined anymore... And now we are stuck so it has to be a bug. (or could it be misuse ?)

helgasoft avatar Aug 03 '24 17:08 helgasoft

This is a production case. Our current sizes now can be: w320px x h875px (screen height: 937px), for graph, size: w500px x h100px.

If you show metrics, they may have long names, and they may also have nested threeholds. this is the reality of the prod. You don't need to refer to the confine prop, you need to fix the positioning of the configuration that I attached the first time. If you think that this is an incorrect condition or not very realistic, look at how other libraries, for example highcharts with large tooltips. Spoiler - they work better and don't consider such usage to be wrong.

Please correct the automatic positioning. The tooltip should not go off the screen if it can fit in the field of the screen. Animation

MariiieP avatar Aug 05 '24 08:08 MariiieP

@helgasoft, any updates?

MariiieP avatar Aug 09 '24 11:08 MariiieP

?

MariiieP avatar Aug 14 '24 14:08 MariiieP

I have nothing more to say, I'm not a developer/contributor to the library. These types of issues are usually resolved by DIY pull request.

helgasoft avatar Aug 14 '24 21:08 helgasoft