public class PercentFormatter extends java.lang.Object implements IValueFormatter, IAxisValueFormatter
| Modifier and Type | Field and Description |
|---|---|
protected java.text.DecimalFormat |
mFormat |
| Constructor and Description |
|---|
PercentFormatter() |
PercentFormatter(java.text.DecimalFormat format)
Allow a custom decimalformat
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDecimalDigits() |
java.lang.String |
getFormattedValue(float value,
AxisBase axis)
Called when a value from an axis is to be formatted
before being drawn.
|
java.lang.String |
getFormattedValue(float value,
Entry entry,
int dataSetIndex,
ViewPortHandler viewPortHandler)
Called when a value (from labels inside the chart) is formatted
before being drawn.
|
public PercentFormatter()
public PercentFormatter(java.text.DecimalFormat format)
format - public java.lang.String getFormattedValue(float value,
Entry entry,
int dataSetIndex,
ViewPortHandler viewPortHandler)
IValueFormattergetFormattedValue in interface IValueFormattervalue - the value to be formattedentry - the entry the value belongs to - in e.g. BarChart, this is of class BarEntrydataSetIndex - the index of the DataSet the entry in focus belongs toviewPortHandler - provides information about the current chart state (scale, translation, ...)public java.lang.String getFormattedValue(float value,
AxisBase axis)
IAxisValueFormattergetFormattedValue in interface IAxisValueFormattervalue - the value to be formattedaxis - the axis the value belongs topublic int getDecimalDigits()