【发布时间】:2017-02-08 03:59:36
【问题描述】:
【问题讨论】:
-
这个问题已经有社区 wiki 回答 here
标签: mpandroidchart
【问题讨论】:
标签: mpandroidchart
根据您的喜好,您可以使用 Entry 的 data 属性来存储标签,然后在您的 IAxisValueFormatter 实现中返回它:
public class LabelValueFormatter implements IAxisValueFormatter {
private final DataSet mData;
public LabelValueFormatter(DataSet data) {
mData = data;
}
@Override
public String getFormattedValue(float value, AxisBase axis) {
// return the entry's data which represents the label
return (String) mData.getEntryForXPos(value, DataSet.Rounding.CLOSEST).getData();
}
}
【讨论】: