Search code examples
javaandroidteechart

Left axis label font reset to red color?


Please recall this code: How to remove the shadow below the center point?

When I display that chart and later switch to a bar/pie chart, the left axis label is set to red. I cannot understand this as I never modify that variable. I'm sure this is a bug.

A workaround is to set the color explicitly before I generate the diagram:

_chart.getAxes().getLeft().getLabels().getFont().setColor(Color.fromArgb(0xffffffff));

Also, relevant function calls may be the following:

_chart.setAutoRepaint(false);
_chart.removeAllSeries();
_chart.getAxes().getBottom().setIncrement(1);

Solution

  • You are right. When the CircularGauge is disposed, the chart axis is restoring wrong default Ticks&MinorTicks pens and Labels font. I've just corrected it for the next maintenance release.