Closed buildtheui closed 3 months ago
Hi @buildtheui
This can be solved by adding a <View>
around the
@Abhinandan-Kushwaha This does not solve the problem, actually this was my first approach and it has the follow problems:
Part of the empty space mention in number 2, it's because I need to increase the xAxisLabelsVerticalShift, so labels don't overlap the horizontal bars, and for some reason whenever I increase this number the top empty space increases too.
When I create a Bar Chart horizontally, the chart does not take up its parent's width; it creates an extra empty height space below the chart.
The only workaround I found, and it is kind of clunky, is to get the parent's width with
onLayout
and add it to the BarChart'swidth
property. To "remove" the below empty height, I have to add a fixed negative numberxAxisLabelsHeight
because what I saw from the code internally, it adds a negative marginBottom. The problem with this approach is that for different screens, I have to change this value so that the chart is not out of the container.Is there a way to make it work in horizontal bar charts?
this is my code