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

[Bug] Line chart display abnormality #19394

Open weijiyang opened 11 months ago

weijiyang commented 11 months ago

Version

5.4.1

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/boring-dew-4w4d9l

Steps to Reproduce

{ "tooltip": { "trigger": "axis", "formatter": "{b}
{a}:{c}人" }, "grid": { "left": "70px", "top": "10px", "bottom": "35px", "right": "10px" }, "xAxis": { "type": "category", "data": [ "2023/12/13 16:56:00", "2023/12/13 16:57:00", "2023/12/13 16:58:00", "2023/12/13 16:59:00", "2023/12/13 17:00:00", "2023/12/13 17:01:00", "2023/12/13 17:02:00", "2023/12/13 17:03:00", "2023/12/13 17:04:00", "2023/12/13 17:05:00", "2023/12/13 17:06:00", "2023/12/13 17:07:00", "2023/12/13 17:08:00", "2023/12/13 17:09:00", "2023/12/13 17:10:00", "2023/12/13 17:11:00", "2023/12/13 17:12:00", "2023/12/13 17:13:00", "2023/12/13 17:14:00", "2023/12/13 17:15:00", "2023/12/13 17:16:00", "2023/12/13 17:17:00", "2023/12/13 17:18:00", "2023/12/13 17:19:00", "2023/12/13 17:20:00", "2023/12/13 17:21:00" ], "boundaryGap": false }, "yAxis": { "type": "value" }, "series": [ { "name": "实时观看人数", "type": "line", "smooth": true, "data": [ "1", "1", "2", "3", "3", "3", "3", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2", "2" ], "symbol": "circle", "areaStyle": { "color": { "type": "linear", "x": 0, "y": 0, "x2": 0, "y2": 1, "colorStops": [ { "offset": 0, "color": "#327DFF" }, { "offset": 1, "color": "#327DFF00" } ], "global": false } } } ] }

image

image

Current Behavior

image

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

echarts-bot[bot] commented 11 months ago

@weijiyang It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Bug] Line graph displays abnormally
weijiyang commented 11 months ago

the bug is Occasionally

helgasoft commented 11 months ago

Glitch could be coming from xAxis data. You have xAxis.type:'category' but your data is actually timestamps. A cleaner and more robust approach is to use xAxis.type:'time' - Demo Code