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

CartesianChart.MouseMove not firing on .NET6/WinForms #1209

Open
beto-rodriguez opened this issue Sep 2, 2023 Discussed in #397 · 4 comments
Open

CartesianChart.MouseMove not firing on .NET6/WinForms #1209

beto-rodriguez opened this issue Sep 2, 2023 Discussed in #397 · 4 comments

Comments

@beto-rodriguez
Copy link
Owner

Discussed in #397

Originally posted by RodLeyton February 13, 2022
Win11/WinForms on .NET6.0 using C#10 on VS2022.
I am trying to receive mouse move events, so I can get the X and Y values via CartesianChart.ScaleUIPoint.

I have registered for the event using

CartesianChart.MouseMove += Chart_MouseMove_new;


Chart_MouseMove_new(object? sender, MouseEventArgs? e) 
{   // Breakpoint
   if (e is null) return;
   //........
}

However it does not fire (tested by debug breakpoint).
Also tried MouseClick and MouseDown events, which I couldn't get to fire either.
I could get ChartPointPointerDown to fire successfully, but I really do need the move event.

Are these events supported yet, or am I missing something here?

beto-rodriguez added a commit that referenced this issue Sep 2, 2023
@beto-rodriguez
Copy link
Owner Author

This is not fixed, take web site article/repo is updated:

https://livecharts.dev/docs/WinForms/2.0.0-rc1/samples.general.scrollable

specially take a look at the `GetDrawnControl() method:

cartesianChart2.GetDrawnControl().MouseMove += CartesianChart2_MouseMove;

@En-JON-eer
Copy link

I can confirm this fix works now.

@En-JON-eer
Copy link

cartesianChart1.GetDrawnControl();
This fixed the issue of handling chart click events.

However,

If I do not call GetDrawnControl();, a tradeoff is made:
I can mouse over data with the tooltip showing all data values seamlessly. TooltipFindingStrategy.CompareAllTakeClosest seems to work beautifully here:
Vl4LQgpk2S

BUT - we cannot pan/zooom/zoom box (right click).

If I call cartesianChart1.GetDrawnControl();,

Pan/zoom/zoom box works fine. But it seems the TooltipFindingStrategy.CompareAllTakeClosest property is lost?
7yUNEHPT8v

image

@En-JON-eer
Copy link

@beto-rodriguez I'm not entirely sure how to re-open this issue.

@beto-rodriguez beto-rodriguez reopened this Nov 7, 2023
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