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

Add setLimitRange() method to the IAxis interface #431

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion org.eclipse.swtchart/src/org/eclipse/swtchart/IAxis.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,19 @@ public enum Position {
void setDrawPositionMarker(boolean drawPositionMarker);

void updatePositionMarker(MouseEvent e);
}

/**
* Sets the minimum and maximum limits for the axis range. These limits
* are enforced during dynamic operations such as {@code adjustRange},
* {@code scroll}, and {@code zoom}. However, they do not restrict
* manual range settings through the {@link #setRange(Range, boolean)} method.
*
* @param minRange
* the minimum value allowed for the axis range.
* @param maxRange
* the maximum value allowed for the axis range.
* @throws IllegalArgumentException
* if {@code minRange} is greater than or equal to {@code maxRange}.
*/
void setLimitRange(double minRange, double maxRange);
}
Original file line number Diff line number Diff line change
Expand Up @@ -860,19 +860,7 @@ public void updatePositionMarker(MouseEvent e) {
tick.getAxisPositionMarker().update(e.x, e.y);
}

/**
* Sets the minimum and maximum limits for the axis range. These limits
* are enforced during dynamic operations such as {@code adjustRange},
* {@code scroll}, and {@code zoom}. However, they do not restrict
* manual range settings through the {@link #setRange(Range, boolean)} method.
*
* @param minRange
* the minimum value allowed for the axis range.
* @param maxRange
* the maximum value allowed for the axis range.
* @throws IllegalArgumentException
* if {@code minRange} is greater than or equal to {@code maxRange}.
*/
@Override
public void setLimitRange(double minRange, double maxRange) {

if(minRange >= maxRange) {
Expand Down
Loading