plot
plot copied to clipboard
Area chart with gradient colors
Is it possible to provide the gradient color to area chart?
You can do this by overriding the draw
field in AreaUnderLine
. Like this, for example:
LinePlot.AreaUnderLine(draw = { path ->
drawPath(path, brush = Brush.verticalGradient(listOf(Color.Red, Color.Yellow)))
})
![Screen Shot 2022-09-22 at 16 15 52](https://user-images.githubusercontent.com/11502338/191771984-d1f575f9-dc9d-4ee1-acc0-35cdc00c0761.png)
To be fair, it would be great to have native support instead of having to override the draw
field. I am thinking of added Brush
as a field, so that the user can either provider a Color
or a Brush
for all the components.
This is going to be a breaking change if the client code is not parameterized, but it an easily fixable one. Adding to Milestone 0.2.0