我想在用户单击时突出显示(更改颜色)饼图特定切片。我可以在示例(下面的代码)中找到可以显示切片索引和确切点的信息。但是重新着色切片呢?
mChartView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint();
if (seriesSelection == null) {
Toast
.makeText(PieChartBuilder.this, "No chart element was clicked", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(
PieChartBuilder.this,
"Chart element data point index " + seriesSelection.getPointIndex()
+ " was clicked" + " point value=" + seriesSelection.getValue(),
Toast.LENGTH_SHORT).show();
}
}
});