I wanna achieve such behavior seen below using PieChart
of MPAndroidChart library.
To do that, I'm setting the ValueFormatter
of PieData
as the following:
data.setValueFormatter(new ValueFormatter() {
@Override
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
if(value > 0)
return floatFormat.format(value) + "\n(XXX)";
else
return "";
}
});
However, the "\n" is somewhat ignored by the ValueFormatter
or PieChart
, and I'm getting the entire value in a single line. What could be the reason for that? How can I achieve multiline value label behavior as seen in the PieChart example seen above?