Skip to content Skip to sidebar Skip to footer

Androidplot Change Color Of Domain And Range Labels

I am using the AndroidPlot library and am trying to change the colour of the domain and range labels. I set them like so: //Setting the names of the axis XYPlot.setRangeLabel('# of

Solution 1:

For anyone using the newer version of AndroidPlot (1.0 and above) this is the new way to update the text colour of the range and domain labels:

plot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.LEFT).getPaint().setColor(Color.RED);
plot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.BOTTOM).getPaint().setColor(Color.RED);

Solution 2:

You want something like

    mTripPlot.getGraphWidget().getDomainLabelPaint().setColor(my_colour);

For the label it would be something like

    mTripPlot.getDomainLabelWidget().getLabelPaint().setColor(my_colour);

Solution 3:

Attempt the following:

plot.getGraphWidget().getDomainTickLabelPaint().setColor(Color.RED);
plot.getGraphWidget().getRangeTickLabelPaint().setColor(Color.RED);
plot.getGraphWidget().getRangeOriginTickLabelPaint().setColor(Color.RED);
plot.getGraphWidget().getDomainOriginTickLabelPaint().setColor(Color.RED);

Post a Comment for "Androidplot Change Color Of Domain And Range Labels"