-
Notifications
You must be signed in to change notification settings - Fork 608
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
Initial implementation of skewed X axis #455
base: release-2.4
Are you sure you want to change the base?
Conversation
Okay, so I came up with some work-arounds for skewed X axis behavior and grid lines. For starters, in
becomes
because it allows for me to check the CPTScaleType for the case of being skewed. Now that I can check if we are dealing with an X-skewed axis, I can fix the issue where the Y-axis lines do not connect with the left hand axis border.
This just manually sets the startViewPoint.x to the 0 value, or the left hand side of the frame. Now, I tried messing around with
to become
Once again, it checks if this is the X-coordinate and if the coordinate is skewed. If it doesn't meet those criteria, then it filters like its normal behavior. If it is the X coordinate AND its skewed, then it it still plots the line. This at the very least allows for one-line code on the API end for providing the axis lines and allowing for them to be drawn, even when beyond the range of the lower-left corner. |
Example image showing that the skewed X lines display beyond the lower-left corner, and that the Y grid lines now intersect the axis line itself.
|
Looking good so far. We need to add an example plot to the Plot Gallery app to demonstrate the capability and aid in testing. We should also add XY plot space unit tests for the new functionality. Let me know if you need help with either of those tasks. |
Cool cool, I'll start by seeing if I can add some XY plot space unit tests first, and then try adding it to the plot gallery. I'll pop by here if I have any troubles! |
This is an initial attempt at a pull request to add the capability for skewed X-axis lines on an X-Y plot. It currently supports a skewed X axis for both linear and logarithmic Y axis types.
I use the words "initial" for a few reasons, one being that I'm relatively new to iOS development and Xcode and I'm not entirely sure about how and where to add appropriate tests for this new feature. Another reason for the word "initial" is that this can and should be extended to skewed Y axes as well, but I want to hold off until there's approval on the method of implementation in
CPTXYPlotSpace
. If a different implementation style is requested, then the functionality can be extended to the Y axis range. Finally, it's "initial" because the behavior of axis grid lines in this context is not super well defined. See #454 for questions/discussion on that. I'd like to be able to implement some good default behavior here, but so far my efforts have not been fruitful.Looking forward to the review and suggestions.