I'm trying to set a gradient color on the green-red line of the circular gauge. However, when using the following code, the major ticks color also changes to the color of the green line gradient.
If I don't use a gradient color on the green line, then the major ticks are displayed with the color (white_smoke) defined in the code. How can I solve this issue?
Also, is there a way to start a gradient color at a specific gauge value, i.e. start yellow color when value = 60?
Code: Select all
circularGauge1 = new CircularGauge(chart.getChart());
circularGauge1.setMinimum(0);
circularGauge1.setMaximum(110);
circularGauge1.getAxis().setIncrement(10);
circularGauge1.getAxis().setMinorTickCount(4);
circularGauge1.setValue(60);
circularGauge1.getTicks().setColor(Color.WHITE_SMOKE);
circularGauge1.getTicks().setVertSize(10);
circularGauge1.getTicks().setHorizSize(4);
circularGauge1.getVertAxis().getMinorTicks().setVisible(true);
circularGauge1.getMinorTicks().setColor(Color.WHITE_SMOKE);
circularGauge1.getMinorTicks().setVertSize(2);
circularGauge1.getMinorTicks().setHorizSize(2);
circularGauge1.setGreenLineStartValue(0.0);
circularGauge1.setGreenLineEndValue(100.0);
circularGauge1.getGreenLine().setVertSize(1);
circularGauge1.getGreenLine().getPen().setVisible(false);
circularGauge1.setRedLineStartValue(100.0);
circularGauge1.setRedLineEndValue(110.0);
circularGauge1.getRedLine().getGradient().setVisible(false);
circularGauge1.getRedLine().setColor(Color.RED);
circularGauge1.getRedLine().setVertSize(1);//
circularGauge1.getRedLine().getPen().setVisible(false);
circularGauge1.getGreenLine().getGradient().setDirection(GradientDirection.BACKDIAGONAL);
circularGauge1.getGreenLine().getGradient().setUseMiddle(true);
circularGauge1.getGreenLine().getGradient().setStartColor(Color.green);
circularGauge1.getGreenLine().getGradient().setMiddleColor(Color.yellow);
circularGauge1.getGreenLine().getGradient().setEndColor(Color.orange);
Many thanks,
E.