Abhinandan-Kushwaha / react-native-gifted-charts

The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
https://www.npmjs.com/package/react-native-gifted-charts
MIT License
702 stars 148 forks source link

Labels on xAxis are not visible | BarChart #614

Closed sanford-fernandes closed 1 month ago

sanford-fernandes commented 4 months ago

I am testing BarChart on my ongoing project and most of the things work as expected. Only issue that is bothering right now is the labels on the xAxis are not displayed at all the way they should. Kindly help!

rrameshbtech commented 4 months ago

+1 For me, Seems based on screen size it is behaving differently. For example, it shows labels in pixel simulator, but in Redme note 11 it is cropping the x axis label. Also xAxisLabelTextStyle does not impact the style. Any help?

rrameshbtech commented 4 months ago

-Update- I am able to workaround using labelComponent. Thanks

sanford-fernandes commented 4 months ago

-Update- I am able to workaround using labelComponent. Thanks

This actually worked! Thank you so much!! @rrameshbtech

Abhinandan-Kushwaha commented 1 month ago

Hi @rrameshbtech Thanks for the solution.

Also, if you don't want to use the labelComponent you can still fix the issue with the help of the following props-

  1. xAxisLabelsHeight
  2. xAxisLabelsVerticalShift
  3. labelsExtraHeight

See the Axes and rules related props