-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
302 additions
and
329 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,13 @@ | |
* 2000000 = 2m; 7800000 = 7.8m; 92150000 = 92m; 123200000 = 123m; 9999999 = | ||
* 10m; 1000000000 = 1b; Special thanks to Roman Gromov | ||
* (https://github.com/romangromov) for this piece of code. | ||
* | ||
* | ||
* @author Philipp Jahoda | ||
* @author Oleksandr Tyshkovets <[email protected]> | ||
*/ | ||
public class LargeValueFormatter implements ValueFormatter, YAxisValueFormatter { | ||
|
||
private static String[] SUFFIX = new String[] { | ||
private static String[] SUFFIX = new String[]{ | ||
"", "k", "m", "b", "t" | ||
}; | ||
private static final int MAX_LENGTH = 4; | ||
|
@@ -32,6 +32,7 @@ public LargeValueFormatter() { | |
|
||
/** | ||
* Creates a formatter that appends a specified text to the result string | ||
* | ||
* @param appendix a text that will be appended | ||
*/ | ||
public LargeValueFormatter(String appendix) { | ||
|
@@ -52,7 +53,18 @@ public String getFormattedValue(float value, YAxis yAxis) { | |
} | ||
|
||
/** | ||
* Set custom suffix to be appended after the values | ||
* Set an appendix text to be added at the end of the formatted value. | ||
* | ||
* @param appendix | ||
*/ | ||
public void setAppendix(String appendix) { | ||
this.mText = appendix; | ||
} | ||
|
||
/** | ||
* Set custom suffix to be appended after the values. | ||
* Default suffix: ["", "k", "m", "b", "t"] | ||
* | ||
* @param suff new suffix | ||
*/ | ||
public void setSuffix(String[] suff) { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,5 +117,4 @@ public Transformer getTransformer() { | |
* @param c | ||
*/ | ||
public abstract void renderLimitLines(Canvas c); | ||
|
||
} |
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
Oops, something went wrong.