public class TimeValueRepresentationStrategy implements ValueRepresentationStrategy
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeValueRepresentationStrategy.Companion |
| Modifier and Type | Field and Description |
|---|---|
static TimeValueRepresentationStrategy.Companion |
Companion |
static long |
MILLISECOND |
| Constructor and Description |
|---|
TimeValueRepresentationStrategy(long offsetMs) |
TimeValueRepresentationStrategy(java.util.TimeZone timeZone) |
TimeValueRepresentationStrategy() |
| 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 long MILLISECOND
public static TimeValueRepresentationStrategy.Companion Companion
public TimeValueRepresentationStrategy(long offsetMs)
public TimeValueRepresentationStrategy(@NotNull
java.util.TimeZone timeZone)
public TimeValueRepresentationStrategy()
@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.