是否有可能在AChartEngine
中设置 x轴/ y轴的线宽?
默认情况下,两个轴的线宽均为1像素。我想将宽度设置为1 dp(或其他),但我在Javadoc中找不到相应的方法。那么,有人知道这是否可能?
答案 0 :(得分:2)
我通过创建自定义图表并覆盖draw()
来解决此问题。
public class CustomChart extends CombinedXYChart {
public CustomChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, String[] types) {
super(dataset, renderer, types);
}
@Override
public void draw(android.graphics.Canvas canvas, int x, int y, int width, int height, android.graphics.Paint paint) {
float strokeWidth = paint.getStrokeWidth();
paint.setStrokeWidth(3); // set your axes line width
super.draw(canvas, x, y, width, height, paint);
paint.setStrokeWidth(strokeWidth);
}
}