apache / echarts

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

[Question] Custom category chart with type='time' doesn't show tooltip #19983

Open jdupont22 opened 3 months ago

jdupont22 commented 3 months ago

Version

5.5.0

Link to Minimal Reproduction

https://gist.github.com/jdupont22/6d99ddbe1d621db4a0a46a629068d6c2

Steps to Reproduce

Launch previous code in the gist and move the cursor to any point.

Current Behavior

The tooltip value is not displayed

Capture d’écran 2024-05-29 à 11 59 38

When I change the type axis from type: 'time' to type: 'category' the tooltip value is displayed, but the render is broken for my custom chart. Can someone tell me why the tooltip is working with type 'category' and not with the type 'time' ?

Capture d’écran 2024-05-29 à 11 59 27

Seem's to be related to tooltip config => trigger: 'axis', without this, the tooltip is displayed by item, but not what I want of course.

Expected Behavior

Tooltip to be displayed with type='time' as for type='category'

Environment

- OS: macOS 14.1.1
- Browser: Brave Version 1.65.126 Chromium: 124.0.6367.118
- Framework: React@18.2+, echarts-for-react: 3.0.2

Any additional comments?

No response

helgasoft commented 3 months ago

simpler alternative with line - Demo.

🚩 Please note that "how to", usage or debugging questions are not supposed to be answered here. Adhere to Official posting recommendations:


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

jdupont22 commented 3 months ago

@helgasoft thanks for the reply,

But the width are not fix. Each item have a start and an end date. And the value are discontinue.

Real exemple Capture d’écran 2024-05-31 à 11 47 32

Capture d’écran 2024-05-31 à 11 48 21

Sorry for the wrong place, but wasn't sure between a BUG and a QUESTION

helgasoft commented 3 months ago

Looks like you'll need custom line - Demo. Timeline charts are doable with ECharts, see other examples.