I need help to align the data labels for my bar graph in ggplot to the center of each bar just above the bar. Also month in the X axis are repeating. Kindly find my ggplot code for my shiny app below,
ggplot(data = chart_m, aes(x = `Reporting Month`, y = `Total tags generating alert`, fill = HSL)) +
geom_bar(stat = "identity", position = 'dodge') +
geom_text(aes(label = `Total tags generating alert`), position = position_dodge(width = .9), vjust = -.1, size = 6) +
scale_x_date(labels = date_format("%b-%y")) +
theme_grey()
For your reference i have attached the image. I need all the data labels to be aligned to each of the bar in the center.
expected output
Any inputs appreciated.
Regards,
Mohan