com.jjoe64.graphview
Interface CustomLabelFormatter
public interface CustomLabelFormatter
if you want to show different labels,
you can use this label formatter.
As Input you get the raw value (x or y) and
you return a String that will be displayed.
graphView.setCustomLabelFormatter(new CustomLabelFormatter() {
public String formatLabel(double value, boolean isValueX) {
if (isValueX) {
if (value < 5) {
return "small";
} else if (value < 15) {
return "middle";
} else {
return "big";
}
}
return null; // let graphview generate Y-axis label for us
}
});
Method Summary |
java.lang.String |
formatLabel(double value,
boolean isValueX)
will be called when the labels were generated |
formatLabel
java.lang.String formatLabel(double value,
boolean isValueX)
- will be called when the labels were generated
- Parameters:
value
- the raw input value (x or y)isValueX
- true if value is a x-value, false if otherwise
- Returns:
- the string that will be displayed. return null if you want graphview to generate the label for you.