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

[Bug] onDrag, not in sync with data on line plot. #17191

Closed
wigsnes opened this issue Jun 9, 2022 · 5 comments
Closed

[Bug] onDrag, not in sync with data on line plot. #17191

wigsnes opened this issue Jun 9, 2022 · 5 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@wigsnes
Copy link

wigsnes commented Jun 9, 2022

Version

5.3.2

Link to Minimal Reproduction

https://codesandbox.io/s/echarts-react-draggable-0szzfl?file=/src/echartTest.tsx

Steps to Reproduce

  1. Drag one of the dashed points.
  2. Release point between two dates.
  3. Now you can not drag the same point by click and hold on the point, you have to find where you let go last time.

Current Behavior

You drag a point off-axis on the X-axis it does not line up next time you want to drag, and you have to remember where you let go.

Expected Behavior

Expect it to stick to the point, and be draggable on the point and not where you left it.

Environment

- OS: CodeSandbox
- Browser: Chrome
- Framework: React

Any additional comments?

EnviousComplexAfghanhound-mobile.mp4
@wigsnes wigsnes added the bug label Jun 9, 2022
@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 Jun 9, 2022
@plainheart
Copy link
Member

This bug may have been fixed in #17007 and the next version v5.3.3 is under release.

Try this demo to check if it works.

@wigsnes
Copy link
Author

wigsnes commented Jun 9, 2022

It still is not working, I only want to move the points in one direction, so modifying your demo to only allow this, it still has the problem of dragging out of the point axis.

I changed the "onPointDragging" function:

function onPointDragging(dataIndex, pos) {
  const val = myChart.convertFromPixel('grid', pos);
  data[dataIndex] = [data[dataIndex][0], val[1]];
  ...

This makes it not possible to drag in y-axis, and my problem is still present.

BoilingCheerfulApatosaur-mobile.mp4

@tarogege
Copy link

why cannot i drag this points in your demo in chrome?

@wigsnes
Copy link
Author

wigsnes commented Jul 8, 2022

why cannot i drag this points in your demo in chrome?

Not sure why my demo do not work anymore.

Here is the code from echarts that show the problem: Try this

@plainheart
Copy link
Member

plainheart commented Jul 8, 2022

@wigsnes Set invisible of the draggable shadow circle to be false, you may see something interesting. You can follow that to try to find out the reason.

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

No branches or pull requests

3 participants