Plotting data out of plotting boundaries

I found myself a solution.
Basically, just finding what is the range of the x axis and adding extra range.
xaxis=dict(range=[-abs(min(map(float, df_fig[β€˜Var%’]))*2 - max(map(float, df_fig[β€˜Var%’]))*0.25), max(map(float, df_fig[β€˜Var%’]))*1.25])

image

fig1 = go.Figure()

# Add a horizontal bar trace
fig1.add_trace(go.Bar(
    y=df_fig_with_format['Metrics'],
    x=df_fig['Var%'],
    orientation='h',
    marker_color=colors,
    name='Var%',
    text=[f"<b>{val:.0%}</b>" if metric.strip() not in ['',' ','   '] else "" for metric, val in zip(df_fig_with_format['Metrics'], df_fig['Var%'])],  # Add text labels conditionally
    textposition='outside',  # Position text outside bars
    
))

# Update layout for a more professional look
fig1.update_layout(
    title='Percent Variation',
    xaxis_title='%',
    xaxis=dict(
        tickformat='.0%',  # Format x-axis as integer percentage
        showgrid=True,  # Show grid lines
        gridcolor='lightgray',  # Grid color
        gridwidth=0.5,  # Grid width
        range=[-abs(min(map(float, df_fig['Var%']))*2 - max(map(float, df_fig['Var%']))*0.25), max(map(float, df_fig['Var%']))*1.25]
        
    ),

my inspiration came from this other post:
Text is cut-off in Plotly horizontal bar chart - Dash Python - Plotly Community Forum