Interactive stacked histogram difficulties

29 views
Skip to first unread message

Judy Lewis

unread,
Sep 8, 2017, 6:00:19 PM9/8/17
to ggplot2
I have created stacked histograms with ggplot and would like to include them in an interactive HTML report. When I use ggplotly to convert the plot to an interactive plot, the cursor tooltip information is incorrect because the x-axis contains dates. (I have found this to be a documented problem https://stackoverflow.com/questions/44770799/date-format-in-tooltip-of-ggplotly). A solution is to use plot_ly directly but I have been unable to find any way to replicate a truly stacked histogram. When I add layout(barmode= 'stack') the histogram is staggered, not stacked. I have searched and searched and have not found good examples of generating these types of histograms using plot_ly. The example on this website https://plot.ly/r/histograms/#stacked-histograms actually shows two examples of overlayed histograms, not stacked. Any ideas of a resource to help me? Thank you!
Reply all
Reply to author
Forward
0 new messages