I'm trying to use plotly to make my graph slightly more interactive. However, when I use it, it is shrinking my graph vertically, is there a way I can stop this, or just stretch my graph vertically again?
here is the code for the graph;
##stacked column chart for expenditure breakdowns
stackedCol <- ggplot(expenditureDS, aes(fill = Category, y=AvgExpenditurePerWeek, x=Category)) +
geom_bar(stat="identity",
width = 0.6,
color = "black",
size = 0.5,
alpha = 0.7) +
theme_minimal() +
theme(legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 0.8)) +
labs(x= "Categories", y = "Expenditure Per Week",
title = "All Households in NZ - Expenditure Breakdowns",
caption = "2008-2020 data") +
theme(
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank()) +
theme(plot.title = element_text(hjust = 0)) +
geom_text(aes(label = if_else(AvgExpenditurePerWeek > 20, as.character(SubCategory), "")),
position = position_stack(vjust = 0.5), size = 2.5, hjust = 0.5, angle = 0) +
scale_y_continuous(labels= dollar_format(prefix="$"))
ggplotly(stackedCol)