我使用串扰是为了能够单击条形图中的条形图并根据Abcd
. 出于某种原因,如果我按下一个条形图,我只会得到数据集的一行,而我应该得到所有数据集。如果我再次选择所有条形,表格仍然只显示一行。
---
title: "Operaitonal dashboard"
author: "Report"
date: 'Date: `r Sys.Date()`'
output:
flexdashboard::flex_dashboard:
orientation: columns
theme: lumen
vertical_layout: scroll
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo=FALSE,
warning= FALSE,
message = FALSE)
library(crosstalk)
library(shiny)
library(plotly)
library(flexdashboard)
library(ggplot2)
library(dplyr)
library(reactable)
##The four dataframes
Abcd<-c("A","A","B","B")
Prod<-c(34,56,56,89)
Div<-c("Ent","Ent","App","High")
dcross1<-data.frame(Abcd,Prod,Div)
Counts<-c(45,67,78,56)
dcross2<-data.frame(Div,Abcd,Counts)
shared_df <- SharedData$new(dcross1, key = ~Abcd, group = "group")
shared_df2 <- SharedData$new(dcross2, key = ~Abcd, group = "group")
```
# Out of stock Report {data-icon="fa-cart-arrow-down" data-orientation=rows}
## Row {data-height="200"}
### Out Of Stock: Store Overview {data-width="200"}
```{r Oos Store}
daily_store_oos_gg<-
ggplot(shared_df,
aes(x=Abcd,
y=Prod,
fill=as.factor(Abcd)
)) +
geom_bar(stat="identity", position="dodge")
# Convert to plotly object
daily_store_oos_ply <-
ggplotly(daily_store_oos_gg)
daily_store_oos_ply
```
## Column {data-width=405}
### Store Overview Out of Stock
```{r out of stock reactable}
daily_item_oos_rctble<-reactable(
shared_df2
)
daily_item_oos_rctble
```