Axis area and the axis title area property in axis class · Issue #1949 · oxyplot/oxyplot · GitHub
Skip to content

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

Open

Description

@ChrisCC6

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

Activity

  1. VisualMelon commented on Nov 27, 2022

    @VisualMelon
    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).

  2. ChrisCC6 commented on Nov 28, 2022

    @ChrisCC6
    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?

  3. VisualMelon commented on Nov 28, 2022

    @VisualMelon
    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.

  4. ChrisCC6 commented on Nov 29, 2022

    @ChrisCC6
    Author

    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.

  5. VisualMelon commented on Dec 2, 2022

    @VisualMelon
    Contributor

    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

  6. ChrisCC6 commented on Dec 6, 2022

    @ChrisCC6
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions