最近我正在制作一个闪亮的项目,想要制作一个带有renderplotly(ggplot对象)的条形图。为什么条形图的负条没有显示在闪亮的应用程序中?不显示负面部分。有什么理由吗?我的代码无关紧要,但它是
我的代码:
g_dpnl_ts <- ggplot(aes(x=time), data=dpnl_ts) +
geom_bar(aes(y=value), fill = "dodgerblue4", stat="identity", size=0.5) + # Specify bar ts plot
geom_abline(slope = 0, intercept = 0, aes(color="red")) + # horizontal line @ y=0
xlab("Period of Observation") + ylab("Millions of US Dollars ($)") + # label
#scale_fill_manual(values = c("tomato", "forestgreen")) + #For conditional coloring
theme(legend.position = "none") + #turn off the legends
scale_x_date(date_breaks = "1 month", date_labels = "%b", date_minor_breaks = "1 month") + #Add x-axis ticks
theme(axis.text = element_text(size = rel(1.25))) + # Change axis label text size
theme(axis.title.x = element_blank()) # Remove x-axis label