public class DefaultValueRepresentationStrategy implements ValueRepresentationStrategy
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultValueRepresentationStrategy.Companion |
| Modifier and Type | Field and Description |
|---|---|
static DefaultValueRepresentationStrategy.Companion |
Companion |
| Constructor and Description |
|---|
DefaultValueRepresentationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
TextWrapper |
getLabel(long value,
long step)
Allows getting a custom value to use for the axis label. E.g. suppose our data points use time as X.
Then we can map the value to a human-readable text like
'16:42'. |
TextWrapper |
getMinifiedLabel(long value,
long step)
There is a possible case that particular value is rather big and occupies a lot of visual space,
e.g. 123432543. We might want to show minified value instead, e.g. ~123M.
|
getLabel, getMinifiedLabelpublic static DefaultValueRepresentationStrategy.Companion Companion
@NotNull public TextWrapper getLabel(long value, long step)
Allows getting a custom value to use for the axis label. E.g. suppose our data points use time as X.
Then we can map the value to a human-readable text like '16:42'.
value - target point's valuestep - a step used by the current axis. E.g. when we draw time stored in seconds, we'd like to use seconds label if possible, like '12:23:43'. 'Step' value would be '1' then. However, it might be that we have so many data points shown at the moment, that it would be reasonable to fallback to seconds, like '12:23'. 'Step' would be '60' in this case. Further on, we can fallback to hours (step 3600) etc.@NotNull public TextWrapper getMinifiedLabel(long value, long step)
There is a possible case that particular value is rather big and occupies a lot of visual space, e.g. 123432543. We might want to show minified value instead, e.g. ~123M.
This method is used for getting such minified labels.