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

Axis area and the axis title area property in axis class #1949

Open
ChrisCC6 opened this issue Oct 8, 2022 · 6 comments · May be fixed by #1966
Open

Axis area and the axis title area property in axis class #1949

ChrisCC6 opened this issue Oct 8, 2022 · 6 comments · May be fixed by #1966

Comments

@ChrisCC6
Copy link

ChrisCC6 commented Oct 8, 2022

Hi,

I'm building an WPF application for analyzing measurement data. The frontend used OxyPlot to display the data. The user is able to select any part of the plot to change the properties over the suitable controls in the menu bar. By selecting a plot part (i.e. series, legends, annotations) it is highlighted with a dotted border with a padding. I can select almost everything but the axes, as the axes area seams not to be captured as area? Or am I blind? :-)

Feature description

It would help to have a area property in the axis class for the axis area and the axis title area to be able to check a screenpoint is within.

Best regards
Chris

@VisualMelon
Copy link
Contributor

Yes, this would be useful.

You can perform hit-testing for axes with the PlotModel.GetAxesFromPoint method at the moment, but it's not quite what you describe (would need a bit of fudging).

@ChrisCC6
Copy link
Author

I already implemented this in the my fork. I currently have two different areas for the axes area and for the title area. Filling the two areas with two different colors looks pretty fine for all available examples.
Maybe you can have a look?

@VisualMelon
Copy link
Contributor

I'd be glad to if you can throw me a link: I don't see it in your fork, but I might just be missing something.

@ChrisCC6
Copy link
Author

ChrisCC6 commented Nov 29, 2022

Forgot to push... My fault. Sorry
image

Works for all examples in the solution. Show case: filling the areas on rendering.
image
For the AngleAxisRenderer as well.

@VisualMelon
Copy link
Contributor

VisualMelon commented Dec 2, 2022

Some interesting stuff in there, couple of notes from a quick scan:

  • Would prefer Annulus over Hypoid (I think hypoid is a more specific concept? feel free to correct me)
  • Would be cool to see if we can use this idea to simplify the GetAxesFromPoint method (and so make it easier to add new axis types)
    • The hit test areas are different; having labels and title separate is useful: may want to add another region for the 'whole', possibly extending into the plot area, though this might be ill defined at the moment
  • IShape might not be the best name, but I can't think of a better one right now
  • Not sure about the TODO about adding a margin to capture clicks; that probably shouldn't be the axes' concern, or if it is, it should be a margin property that is configurable: can you expand on the idea there?

Feel free to open a PR for this: will make it easier for us to discuss specifics

@ChrisCC6
Copy link
Author

ChrisCC6 commented Dec 6, 2022

Regarding your points:

  • Rename Hypoid to Annulus -> valid point: done
  • I renamed AxisArea to AxisLineArea (green) -> capturesjust the AxisLine, TitleArea (blue) stays the same and added another AxisArea (red) for the whole Axis
    image
  • IShape might be better IContour, but this would be a minor one
  • the TODO is about the following: what if the major/minor tick length is zero or TickStyle is None and the there are no labels drawn due some use case specific reason. This would result that the AxisLineArea would be equal the line stroke dimensions. For user interaction maybe not the best, as it will be very hard to select it with the mouse (e.g. my application is mainly driven by mouse interaction to select an configure -> all elements are wrapped in separate viewmodels).
  • will open a PR

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

Successfully merging a pull request may close this issue.

2 participants