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

[Feature] Tooltips on line series - also show on line segments #19860

Open
ob-ARC opened this issue Apr 23, 2024 · 3 comments
Open

[Feature] Tooltips on line series - also show on line segments #19860

ob-ARC opened this issue Apr 23, 2024 · 3 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@ob-ARC
Copy link

ob-ARC commented Apr 23, 2024

What problem does this feature solve?

My use case is a line series with steps, i.e. it only consists of vertical and horizontal segments. Our users would like to see tooltips on the line segments as well, indicating the current value of y on the horizontal segments, and the value of x on the vertical segments. I would suggest that the data sent to the formatter are either interpolated (I assume that calculation is not performance-critical), or the data of the nearest data point is used (this was already mentioned in #15437).

Example:

https://echarts.apache.org/examples/en/editor.html?c=line-simple&version=5.5.0&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AG4CGANgK5W0A0J6AthNCIAGbqVi9GGIgHYSAX1GxyOfEVRiK1OkzYdFfAcP3jJRAMzzFYYMGaQQanrDwALYAHciYAE7tLJPCpvCCpCWABtJ3UxWAgAEzpmASoARi4ndGhGXhpYWiToVPSYskpc_OTimLxyXgAjWzoAYwhvJuY9DOc3dwBlWobmL18qY3Qa-tteiAAvXJSRLrjGMEYicPCUzhSAXU4IgCZtvcPOA5PwszOLq9398IAWY_un8_uAVmuP54iANmO9l1rLZ7I4SugAPQQgBmwG8EjAYCCRGhrGgTUgMAAFCBGN5snh9pAmgBrKhgfZNFjMOqMUkASmQsG85NY3jgtCReDAtAA3OgFF10LD4Sskd46EhGHJkE05FUSq4PMN2GNSIwQNRoHEACrAABCwDi5BVVC6cicgrE0TE8USyQOCtIWRy9sKjrVmnKBU6ioGjTyLTaHSd4x6_UmQzIIzVE0G0zmRAWauWq3W4REdwiWzepwOADp3jczvmDkWXiXpOWIp8C9Xwv8UvmqztASVgXYIA5iODYCKEeKUWiMVBoDi8QSiRBSeTKdTaQymSywGyOVyefzYFbwVD-2LkXkpTKkHLQ6QlZ5o6qhbANVrdQajSar2aShaxO_YDsUHJeUA

What does the proposed API look like?

No additional API required.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Apr 23, 2024
@helgasoft
Copy link

if both axes can be converted to type 'category', then axisPointer could be used instead of tooltip - Demo

@ob-ARC
Copy link
Author

ob-ARC commented Apr 24, 2024

if both axes can be converted to type 'category', then axisPointer could be used instead of tooltip

I know that, but it is not an option.

@ob-ARC
Copy link
Author

ob-ARC commented Apr 26, 2024

If anybody is interested, the following example shows how a hint on the line (showing the closest data point, interpolation not possible as far as I can see) can be achieved by using mouse event handlers and the showTip/hideTip actions via dispatchAction:

https://jsfiddle.net/gjrn97pm/4/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants