Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Area chart with gradient colors #12

Open
abhay-quickbit opened this issue Jun 8, 2022 · 2 comments
Open

Area chart with gradient colors #12

abhay-quickbit opened this issue Jun 8, 2022 · 2 comments
Assignees
Labels
good first issue Good for newcomers question Further information is requested
Milestone

Comments

@abhay-quickbit
Copy link

Is it possible to provide the gradient color to area chart?

@thsaravana thsaravana self-assigned this Sep 22, 2022
@thsaravana
Copy link
Member

thsaravana commented Sep 22, 2022

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

@thsaravana thsaravana added enhancement New feature or request question Further information is requested and removed enhancement New feature or request labels Sep 22, 2022
@thsaravana
Copy link
Member

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

@thsaravana thsaravana added this to the 0.2.0 milestone Sep 22, 2022
@thsaravana thsaravana added the good first issue Good for newcomers label Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants