Skip to content

Commit

Permalink
Merge pull request #432 from QuocDoBV/develop
Browse files Browse the repository at this point in the history
Add setLimitRange() method to the IAxis interface
  • Loading branch information
eselmeister authored Dec 12, 2024
2 parents dd3ee5c + 575a9be commit 6821d6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
15 changes: 15 additions & 0 deletions 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

0 comments on commit 6821d6c

Please sign in to comment.