MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Change line color between two entries in a line chart(Define color zones)

Open rohangoqii opened this issue 8 years ago • 5 comments

In a line chart, is it possible to change the line color between two entries of a single dataset by defining a threshold or multiple threshold values.?

For example if the range of my values is from 30 - 100. I want the lines to be green while they are below 50. If a certain line goes past 50 it should change from green to yellow.

I would like to define multiple color brackets based on values. So 30 - 50 would be green, 50-70 would be yellow and above 70 would be red. The line color should change if I go into a new zone(bracket)

rohangoqii avatar May 09 '17 06:05 rohangoqii

setColors(ArrayList<Integer> colors)

see on wiki

603530013 avatar May 09 '17 09:05 603530013

^^ This is not what I asked.

rohangoqii avatar May 09 '17 10:05 rohangoqii

maybe override drawLinear in LineChartRender

603530013 avatar May 10 '17 01:05 603530013

Yup, exactly what I'm looking at.

rohangoqii avatar May 12 '17 05:05 rohangoqii

Yup, exactly what I'm looking at.

Did you manage to do it @rohangoqii ? If you could can you please provide sample code for it?

muaviyaijaz avatar Feb 28 '22 16:02 muaviyaijaz