我想在MPAndroid图表(条形图)中更改所选XAxis的颜色
以下是我的代码。
XAxis xl = mChart.getXAxis();
xl.setTypeface(tf);
xl.setPosition(XAxis.XAxisPosition.BOTTOM);
s = new String[]{"S", "M", "T", "W", "T", "F", "St"};
ArrayList<String> xVals = new ArrayList<String>();
for (int i = 0; i < s.length; i++) {
xVals.add(s[i]);
}
选择XAxis的方法
@Override
public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
Log.i("X val", "Selected X Valu: " + s[h.getXIndex()]);
if (e == null)
return;
RectF bounds = mChart.getBarBounds((BarEntry) e);
PointF position = mChart.getPosition(e, YAxis.AxisDependency.LEFT);
}
选择后,我想更改s[h.getXIndex()]