public class DateAsXAxisLabelFormatter extends DefaultLabelFormatter
Modifier and Type | Field and Description |
---|---|
protected java.util.Calendar |
mCalendar
calendar to avoid creating new date objects
|
protected java.text.DateFormat |
mDateFormat
the date format that will convert
the unix timestamp to string
|
mNumberFormatter, mViewport
Constructor and Description |
---|
DateAsXAxisLabelFormatter(Context context)
create the formatter with the Android default date format to convert
the x-values.
|
DateAsXAxisLabelFormatter(Context context,
java.text.DateFormat dateFormat)
create the formatter with your own custom
date format to convert the x-values.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatLabel(double value,
boolean isValueX)
formats the x-values as date string.
|
setViewport
protected final java.text.DateFormat mDateFormat
protected final java.util.Calendar mCalendar
public DateAsXAxisLabelFormatter(Context context)
context
- the application contextpublic DateAsXAxisLabelFormatter(Context context, java.text.DateFormat dateFormat)
context
- the application contextdateFormat
- custom date formatpublic java.lang.String formatLabel(double value, boolean isValueX)
formatLabel
in interface LabelFormatter
formatLabel
in class DefaultLabelFormatter
value
- raw valueisValueX
- true if it's a x value, otherwise false