https://kotlinlang.org logo
Title
j

Jonas Frid

01/31/2022, 7:44 AM
Hello! I need to have line charts in my app that is almost entirely built with Compose. I was looking at MPAndroidChart at first, but I need a feature that I could not find was available. All values have defined ranges with a color so the color of the line needs to change in a smooth way as the line moves through those ranges. Any suggestions about a good charting component that this is easy to do?
Does anyone have a custom LineChartRenderer with drawHorizontalBezier that does this? Draw the line segments between the points in different colors?
t

tad

02/04/2022, 3:38 AM
You can draw lines in Canvas using a Brush to achieve something close. It looks like a plain horizontal LinearGradient to me.