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

Crosshair only accurate when using default CurveType.MonotoneX in AreaChart #518

Open
dennisadriaans opened this issue Jan 2, 2025 · 3 comments

Comments

@dennisadriaans
Copy link

dennisadriaans commented Jan 2, 2025

When using VisArea, the VisCorsshair is only accurate when using the default CurveType.

Any tips on how to make it accurate with all CurveTypes?

Screenshot from 2025-01-02 17-07-33

@lee00678
Copy link
Collaborator

lee00678 commented Jan 2, 2025

Hi @dennisadriaans, we follow the d3 curveType algorithm. Sometimes, when you choose a curveType like Basis, the area will be curved away from the original data position. Crosshair, however, will render the Y value in the dataset. That's why you see the difference. I'd say in this case, the crosshair is showing the accurate data.

@dennisadriaans
Copy link
Author

Thanks for your reply, @lee00678. Is there any way to correct or adjust the values so that both of the small dots in the image match the curve? It's a little hard to see in the image as I see it now, but the two dots that are the crosshairs (right?) are a bit off.

@lee00678
Copy link
Collaborator

lee00678 commented Jan 3, 2025

@dennisadriaans, I'm not sure if there's a straight forward way to easily make crosshair match the line. You may be able to achieve it by applying B-spline on your dataset. But I'm not sure if that's what you want because that changes the original data. Is there a reason you don't want to use MonotoneX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants