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

LineSeries Tracker doesn't show (at wpf) #2052

Open
Zird231 opened this issue Nov 22, 2023 · 1 comment
Open

LineSeries Tracker doesn't show (at wpf) #2052

Zird231 opened this issue Nov 22, 2023 · 1 comment

Comments

@Zird231
Copy link

Zird231 commented Nov 22, 2023

When you have two LineSeries in your PlotModel, one is visible, the other is not. Give them a tracker to show, then add points in both of them, and switch the invisible LineSeries to visible after that. Then you will see the original visible one's tracker can be shown, the other can't

Steps to reproduce

  1. Create a plotview, add two LineSeries, use Legend to controll their visibility to one visible, and the other isn't.
  2. Add tracker and bind a tracker event to your LineSeires, Any tracker and any event will do.
  3. Add points to those two LineSeires, use legend to let the invisible LineSeries be visible.
  4. Then you will see the tracker dosen't show at the series that is used to be invisible.

And I think I found the problem.

https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/Series/LineSeries.cs
At the line 300, it uses SmoothedPoints property to Get Nearest Interpolated Point. And when a LineSeries is invisible, it will not calculate it's SmoothedPoints, even if you use legend to show it. So its SmoothedPoints is empty here which causes its tracker doesn't show. Maybe the author should use ResetSmoothedPoints() method before the Get method or at the LegendHitTest.

@Zird231 Zird231 changed the title LineSeries Tracker doesn't show LineSeries Tracker doesn't show (at wpf) Nov 22, 2023
@VisualMelon
Copy link
Contributor

Thanks for reporting this and describing your findings: shall try to look at this over the weekend if I have time.

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