Skip to content

Stacked Bar Chart remove initial space in X-axis #738

@AdityaAA2004

Description

@AdityaAA2004

I am trying to use the Stacked Bar chart, and I have almost got everything in place, however, there is a huge initial spacing between Y-axis and the initial label of X-axis. How to reduce that space?

image

This is the bar chart code:
<StackedBarChart hideLegend data={{ labels: daysOfWeek, legend: ["Completed", "Planned"], data: convertedStackedData, barColors: ["rgba(160, 32, 240, 1)", "rgba(128, 128, 128, 0.6)"], }} width={screenWidth - 70} height={220} withInnerLines={false} decimalPlaces={0} yAxisSuffix={yAxisSuffix} chartConfig={{ linejoinType: "bevel", backgroundGradientFrom: "#f3f3f3", backgroundGradientTo: "#f3f3f3", color: (opacity = 1) =>rgba(0, 0, 255, ${opacity}), labelColor: (opacity = 1) => rgba(0, 0, 0, ${opacity}), barPercentage: 0.75, // Adjust bar percentage to better align with labels propsForBackgroundLines: { strokeWidth: 0, }, }} style={{ marginVertical: 8, borderRadius: 16, }} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions