Custom Labels on Axis
Posted: Fri Feb 17, 2012 3:02 pm
Hi,
I'm attempting to create a custom label on an Axis but I am unable to format the label in any way. (Using Java for Android). For example:
chart.getAxes().getLeft().getLabels().getItems().clear();
for(int i = 0; i < chart.getAxes().getLeft().getMaximum()+2; i ++) {
chart.getAxes().getLeft().getLabels().getItems().add((double)i,i+"");
chart.getAxes().getLeft().getLabels().getItems().getItem(i).setColor(Color.WHITE); // NO EFFECT
}
chart.getAxes().getLeft().getLabels().getFont().setSize(13); // NO EFFECT
chart.getAxes().getLeft().getLabels().getFont().setColor(Color.WHITE);
chart.getAxes().getLeft().getLabels().getFont().setName("Arial");
The above creates the customer Label, But I am completely unable to set the font size, color, etc. It simply does not work. Everything remains at the default values.
What am I doing wrong?
thx.
Steven
I'm attempting to create a custom label on an Axis but I am unable to format the label in any way. (Using Java for Android). For example:
chart.getAxes().getLeft().getLabels().getItems().clear();
for(int i = 0; i < chart.getAxes().getLeft().getMaximum()+2; i ++) {
chart.getAxes().getLeft().getLabels().getItems().add((double)i,i+"");
chart.getAxes().getLeft().getLabels().getItems().getItem(i).setColor(Color.WHITE); // NO EFFECT
}
chart.getAxes().getLeft().getLabels().getFont().setSize(13); // NO EFFECT
chart.getAxes().getLeft().getLabels().getFont().setColor(Color.WHITE);
chart.getAxes().getLeft().getLabels().getFont().setName("Arial");
The above creates the customer Label, But I am completely unable to set the font size, color, etc. It simply does not work. Everything remains at the default values.
What am I doing wrong?
thx.
Steven