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

Mouseover Position wrong when char is in a scaled div #550

Closed
jogibear9988 opened this issue Jan 30, 2021 · 5 comments
Closed

Mouseover Position wrong when char is in a scaled div #550

jogibear9988 opened this issue Jan 30, 2021 · 5 comments

Comments

@jogibear9988
Copy link

Describe the bug
Host the chart in a div wich has a scale applied (for example transform: scale(1.5) then when you move the mouse over the chart, the position is wrong.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://nhn.github.io/tui.chart/latest/tutorial-example08-01-line-chart-basic
  2. Open the Dev-tools
  3. Go to the div with id : 'chart-area'
  4. Add style : 'transform: scale(1.5)'

Expected behavior
Mouse position should be correct

@jung-han
Copy link
Member

jung-han commented Feb 2, 2021

Thanks for the bug reporting!
I checked the issue. It looks like a simple problem, if you are interested, please also PR.

@jogibear9988
Copy link
Author

jogibear9988 commented Feb 4, 2021

@jung-han

Don't think is a so simple problem.
Apex Charts has the same: apexcharts/apexcharts.js#1991

I tried to work on it on apex charts, but didn't have time to finish it.

Problem is, not only "transform" css property has an effect, also "zoom". Then also the chart could be hosted in a webcomponent, wich need to be thought of.
I've worked on similar problems at my project here: https://github.com/node-projects/web-component-designer
But at the moment, I've not yet found a good solution to correct the mouse positions.

jung-han pushed a commit that referenced this issue Mar 3, 2021
* fix: calculate mouse position with scale

* chore: add comment
@jung-han
Copy link
Member

jung-han commented Mar 9, 2021

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

@stale stale bot added the inactive label Jun 2, 2021
@jogibear9988
Copy link
Author

thx

@stale stale bot removed the inactive label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants