【发布时间】:2017-09-13 23:56:45
【问题描述】:
我想在选择一个值时显示一个带有特定数据的标签,就像在我想要的演示图像中一样:
所以我粘贴了这段代码(在示例的源代码中找到):
protected RectF mOnValueSelectedRectF = new RectF();
@Override
public void onValueSelected(Entry e, Highlight h) {
if (e == null)
return;
RectF bounds = mOnValueSelectedRectF;
mChart.getBarBounds((BarEntry) e, bounds);
MPPointF position = mChart.getPosition(e, AxisDependency.LEFT);
Log.i("bounds", bounds.toString());
Log.i("position", position.toString());
Log.i("x-index",
"low: " + mChart.getLowestVisibleX() + ", high: "
+ mChart.getHighestVisibleX());
MPPointF.recycleInstance(position);
}
但它不起作用,显示日志但屏幕上没有任何反应。 我忘记或错过了什么
【问题讨论】: