```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
                      message = FALSE,
                      warning = FALSE,
                      out.width = "100%",
                      out.height = "500px",
                      fig.align = "center",
                      fig.height = 7,
                      dpi = 300)
```

```{r}
interactive <- FALSE
```


```{r libraries}
library(tidyverse)
library(lubridate)
library(tidyquant)
library(plotly)

```

```{r scripts}

source(file = "../../../../../Documents/Programming and Data Science/R/DS4B_101_R_Business_Analysis/00_scripts/plot_sales.R")
```

```{r}
bike_orderlines_tbl <- read_rds("../../../../../Documents/Programming and Data Science/R/DS4B_101_R_Business_Analysis/00_data/bike_sales/data_wrangled/bike_orderlines.rds")
```

# Total Sales Charts {.tabset .tabset-fade .tabset-pills}

## Quarterly Sales Trends

```{r}
plot_total_sales(unit = "quarter", interactive = interactive)
```

## Monthly Sales Trends

```{r}
plot_total_sales(unit = "month", interactive = interactive)
```

## Weekly Sales Trends

```{r}
plot_total_sales(unit = "week", date_format = "%Y-%m-%d", interactive = interactive)
```

# Category Sales Charts {.tabset .tabset-fade .tabset-pills} 

## Road {.tabset .tabset-fade} 

### Quarterly

```{r, out.height="1000px"}
plot_categories(category_1 = "Road", unit = "quarter", ncol = 1, interactive = interactive)
```

### Monthly

```{r, out.height="1000px"}
plot_categories(category_1 = "Road", unit = "month", ncol = 1, interactive = interactive)
```

### Weekly

```{r, out.height="1000px"}
plot_categories(category_1 = "Road", unit = "week", date_format = "%Y-%m-%d", ncol = 1, interactive = interactive)
```

## Mountain {.tabset .tabset-fade} 

### Quarterly

```{r, out.height="1000px"}
plot_categories(category_1 = "Mountain", unit = "quarter", ncol = 1, interactive = interactive)
```

### Monthly

```{r, out.height="1000px"}
plot_categories(category_1 = "Mountain", unit = "month", ncol = 1, interactive = interactive)
```

### Weekly

```{r, out.height="1000px"}
plot_categories(category_1 = "Mountain", unit = "week", date_format = "%Y-%m-%d", ncol = 1, interactive = interactive)
```