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

How can i have different grid colour in CartesianGrid based on y axis and xaxis range value? #2896

Open
1 task done
AastickPhilips opened this issue Jul 8, 2022 · 2 comments
Labels
enhancement Enhancement to a current API feature request Issues that are feature requests

Comments

@AastickPhilips
Copy link

AastickPhilips commented Jul 8, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://0qbrh4.csb.app/

Steps to reproduce

How can i have different grid colour in CartesianGrid based on y axis and xaxis range value?

What is expected?

I wanted different grid color based on x axis and yaxis value

What is actually happening?

currently it's taking 1 colour

Environment Info
Recharts v2.1.6
React 17.0.2
System Windows
Browser Google Chrome 103.0.5060.114
@ckifer
Copy link
Member

ckifer commented Jan 3, 2023

I don't think there is a current way to do this (especially based off of y and x values. you could play with the following props

 horizontalFill={['#555', '#222', '#777']}  verticalFill={['#cbe', '#bac', '#bbb']}

but that probably isn't what you want. Labeling a feature request. horizontal and vertical might be something to try as they take a renderer function, but I haven't attempted it.

@ckifer ckifer added enhancement Enhancement to a current API feature request Issues that are feature requests labels Jan 3, 2023
@wmy94827
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to a current API feature request Issues that are feature requests
Projects
None yet
Development

No branches or pull requests

3 participants