我使用Steema TeeChart JAVA for Android来创建图表。 使用以下代码我试图更改图表边框的颜色,但它不会产生任何影响。
public void setBorderColor(Color borderColor){
tChart.getWalls().getRight().setColor(borderColor);
tChart.getWalls().getLeft().setColor(borderColor);
tChart.getWalls().getBottom().setColor(borderColor);
tChart.getWalls().getBack().setColor(borderColor);
}
答案 0 :(得分:2)
尝试更改笔颜色getPen()
,而不是更改墙壁颜色。即:
public void setBorderColor(Color borderColor){
tChart.getWalls().getRight().getPen().setColor(borderColor);
tChart.getWalls().getLeft().getPen().setColor(borderColor);
tChart.getWalls().getBottom().getPen().setColor(borderColor);
tChart.getWalls().getBack().getPen().setColor(borderColor);
}
您可能也有兴趣更改轴笔颜色。即:
public void setBorderColor(Color borderColor){
tChart.getWalls().getRight().getPen().setColor(borderColor);
tChart.getWalls().getLeft().getPen().setColor(borderColor);
tChart.getWalls().getBottom().getPen().setColor(borderColor);
tChart.getWalls().getBack().getPen().setColor(borderColor);
tChart.getAxes().getLeft().getAxisPen().setColor(borderColor);
tChart.getAxes().getBottom().getAxisPen().setColor(borderColor);
}