-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed non visible 0% tick axis since the switch to SWTChart 0.14.0
Issue: #4372
- Loading branch information
Showing
7 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...n.portfolio.ui/src/name/abuchen/portfolio/ui/util/format/AxisTickPercentNumberFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package name.abuchen.portfolio.ui.util.format; | ||
|
||
import java.text.DecimalFormat; | ||
import java.text.FieldPosition; | ||
import java.text.Format; | ||
import java.text.ParsePosition; | ||
|
||
public class AxisTickPercentNumberFormat extends Format | ||
{ | ||
private String decimalFormat; | ||
private static final long serialVersionUID = 1L; | ||
|
||
public AxisTickPercentNumberFormat(String decimalFormat) | ||
{ | ||
this.decimalFormat = decimalFormat; | ||
} | ||
|
||
@Override | ||
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) | ||
{ | ||
if (!(obj instanceof Number)) | ||
throw new IllegalArgumentException("object must be a subclass of Number"); //$NON-NLS-1$ | ||
|
||
toAppendTo.append(new DecimalFormat(decimalFormat).format(((Number) obj).doubleValue())); | ||
|
||
return toAppendTo; | ||
} | ||
|
||
@Override | ||
public Object parseObject(String source, ParsePosition pos) | ||
{ | ||
pos.setErrorIndex(0); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters