我想在用戶點擊時突出顯示餅圖特定切片(更改顏色)。 我可以在樣本(下面的代碼)中找到它可以顯示切片的索引和確切點。但是如何重新着色切片呢?在AChartEngine中單擊時突出顯示餅圖切片
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();
}
}
});
地方,所以我們需要添加呢? – Goofy
旁邊的問題中的代碼。請參閱:http://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/PieChartBuilder.java –