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

draggable axis line limits #32

Closed
Ichibot200 opened this issue Jun 27, 2019 · 2 comments
Closed

draggable axis line limits #32

Ichibot200 opened this issue Jun 27, 2019 · 2 comments
Assignees

Comments

@Ichibot200
Copy link

Ichibot200 commented Jun 27, 2019

Perhaps there should be possibility to keep the draggable line within plot area? Right now if I drag a line out of plot area, I can never access it again - that is of course if I have defined my axis region manually and is rendered every iteration in such area.

Maybe defining V or H lines like:

public void PlotVLine(double x, Color? color = null, double lineWidth = 1, string label = null, bool draggable = false, bool bounds = false, double xMin = 0, double xMax = 50)
@swharden
Copy link
Member

This is a good idea. I'll put this in shortly.

I'll probably add arguments so you can call it like like:

plt.PlotVLine(123, draggable: true, dragLimitLower: 0, dragLimitUpper: 1000);

And those limits will default to - and + infinity if not specified.

@swharden swharden self-assigned this Jun 27, 2019
@swharden swharden changed the title draggable lines out of bounds? draggable axis line limits Jun 27, 2019
@swharden
Copy link
Member

I added 2 extra arguments to let you limit how far the user can drag a draggable axis line. 6af45af

scottPlotUC1.plt.PlotVLine(position, draggable: true, dragLimitLower: 0, dragLimitUpper: 49);

By default those arguments are negative and positive infinity (no restriction on dragging).

I'll publish this with the next NuGet release

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