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

Support for secondaryXAxis #642

Closed
devevecare opened this issue May 22, 2024 · 1 comment
Closed

Support for secondaryXAxis #642

devevecare opened this issue May 22, 2024 · 1 comment

Comments

@devevecare
Copy link

Hi,

I can see there is secondaryYAxis props in bar chart, can we have similar for x axis as well.

As you can see in the video, which is from an app which I am referring to make my current app, we have x axis labels and as well as labels at the top of the axis for each month.

Can we support this?

chart-xaxis.mp4
@Abhinandan-Kushwaha
Copy link
Owner

Hi @devevecare 👋
Thanks for requesting this feature. It is now available from version 1.4.18 onwards.🎉

Added the prop secondaryXAxis to render an additional X axis at the top of the chart.

The labels to be displayed along the secondary X-axis can be passed in these 2 ways-

  1. Through the property named secondaryLabel in the data array
  2. Through the property named labelTexts in the secondaryXAxis prop.

The secondaryXAxis props accepts an object of the following type-

XAxisConfig {
  thickness?: number
  color?: ColorValue
  labelsDistanceFromXaxis?: number
  labelsHeight?: number
  labelsTextStyle?: any
  labelTexts?: string[]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants