# Ggplotly differences when using fill=

**URL:** <https://community.plotly.com/t/ggplotly-differences-when-using-fill/3221>\
**Category:** Plotly R\
**Created:** [January 30, 2017, 5:09pm UTC](https://community.plotly.com/t/ggplotly-differences-when-using-fill/3221 "2017-01-30T17:09:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanicky](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@ryanicky](https://community.plotly.com/u/ryanicky)\
**Post date:** [January 30, 2017, 5:09pm UTC](https://community.plotly.com/t/ggplotly-differences-when-using-fill/3221/1 "2017-01-30T17:09:47Z")

</div>

I have “simple” plot in ggplot and would like to wrap it with ggplotly. I specify a bar color using fill= and when I do the bar inacticivity goes away.

library(ggplot2)  
library(plotly)  
cnt \<-c(2,1)  
date \<- c(“2016-01-05 13:53:43”,“2016-01-15 09:33:40”)  
xx.df \<- data.frame(date,cnt)  
xx.df$datep \<- as.Date(xx.df$date,format="%Y-%m-%d %H:%M:%S")  
xx.df$datea \<- as.character(xx.df$date,format="%Y-%m-%d %H:%M:%S")  
xx.df$status \<- as.factor(c(“Success”,“Fail”))

pa \<- ggplot(xx.df,aes(x=datea,y=cnt,fill=status))  
pa \<- pa+geom\_bar(stat=“identity”)  
print(ggplotly(pa))

1. I can’t click to remove a series using the legend, both bars go away.
2. Mouse hover is not present.

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/1X/4225b58fdfed7b7532967bcd75bb962b72b0051b.png)

When I remove fill= I get a grey plot without a legend. But the mouse hover works…

pag \<- ggplot(xx.df,aes(x=datea,y=cnt))

pag \<- pag+geom\_bar(stat=“identity”)

print(ggplotly(pag))

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/1X/f77f798e11ba89abbc7789407262189414a079ae.png)

Is there an issue with how I used the fill=? I am using plotly 4.5.6,ggplot2 2.2.1

Thanks,

Richard
