echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Too many points on a mixed chart of scatter and line would cause canvas not to be cleared correctly

Open bbeas opened this issue 2 years ago • 7 comments

Version

5.4.3

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/large-scale-candlestick-forked-mtvc4k?file=%2Findex.js%3A135%2C19

Steps to Reproduce

  1. Add a line series and a scatter series on one chart
  2. scroll to zoom in and zoom out
  3. The line would not be cleared properly on the canvas

Current Behavior

image It seems like only the lines would be left on the canvas when zooming in and zoom out. If I change one of the two specific types to another type, e.g., change 'line' to 'candlestick', the problem would not occur.

Expected Behavior

Lines and scatters be rendered properly together

Environment

- OS: macOS 12.7.2 (Apple M2)
- Browser: Version 120.0.6099.234 (Official Build) (arm64)
- Framework: React

Any additional comments?

No response

bbeas avatar Jan 31 '24 06:01 bbeas

missing Minimal Reproduction - Sandbox not found

helgasoft avatar Jan 31 '24 07:01 helgasoft

missing Minimal Reproduction - Sandbox not found

https://codesandbox.io/p/sandbox/large-scale-candlestick-forked-mtvc4k?file=%2Findex.js%3A118%2C5 what about this? Just changed its permission to public

bbeas avatar Jan 31 '24 07:01 bbeas

adding large: true to all three series seems to work ok - Demo Code 📌 please close issue if problem solved.

helgasoft avatar Jan 31 '24 08:01 helgasoft

It works on this minimal reproduction demo, but not on my own code 😭 Still trying to figure out if there are any other factors affecting the behaviour, such as type="time" or the series of my xAxis data not having fixed time intervals If possible, keep the issue open and I'll update it whenever I have some progress. Thanks.

bbeas avatar Jan 31 '24 09:01 bbeas

It seems that the demo works even without large: true with @helgasoft 's link. @bbeas Please make sure you are using the latest version. You'd better use ECharts's official link to create the demo. If the problem exists, you need to minify the code and remove all unncessary code to help find what caused this problem.

Ovilia avatar Jan 31 '24 09:01 Ovilia

It seems that the demo works even without large: true with @helgasoft 's link. @bbeas Please make sure you are using the latest version. You'd better use ECharts's official link to create the demo. If the problem exists, you need to minify the code and remove all unncessary code to help find what caused this problem.

The problem could simply occur if I comment the large: true in @helgasoft 's demo code on my laptop (Macbook Pro M2 2022 with 16GB memory). It happens with both ECharts v5.4.3 and v5.5.0-rc.1. Do you have any ideas about this? image image

bbeas avatar Jan 31 '24 14:01 bbeas

Fixed the problem by changing type: scatter to type: line and set lineStyle: {width: 0} to hide the line. This could just achieve the expected behaviour without the problem above when zooming in and out.

bbeas avatar Feb 01 '24 02:02 bbeas

Hmmm. It's possible that problem comes from the

  tooltip: {
    trigger: 'axis'
  },

If you change trigger type to the 'item', behavior will be normal. But it's not fit to your design....... 🤔

AndreyPatseiko avatar Mar 06 '24 11:03 AndreyPatseiko