LineChart : Change circle color after apply gradient color
Hi,
i have a problem about my linechart's circles. I use this method to make a Gradient LineChart :
Paint paint = mChart.getRenderer().getPaintRender(); int height = mChart.getHeight(); LinearGradient linGrad = new LinearGradient(0, 0, 0, height, getResources().getColor(R.color.red_chart), getResources().getColor(R.color.green_chart), Shader.TileMode.MIRROR); paint.setShader(linGrad);
After I write this to change circle's color :
lineDataSetCircle.setCircleColor(Color.WHITE);
But now the circle's color stay red and clearColor change nothing :/
How can I change this please ?
I have the same issue, the reason setCircleColor does not work is the circles are cached as bitmaps at location (radius,radius) and uses the same renderpaint as line. so circle gets the color from gradient at that location. these cached bitmaps are positioned on the data point to display on chart.
so setCircleColor with gradient has no effect. also the circle color doesnot change with the gradient aswell. in order to achieve this LineRenderer Class has to be modified to draw circles with different color, may be clone render paint and remove shader to draw circle.
Is there a way around this? Still relevant on v3.1.0