---
title: "Олон улсын экономикс (гэрийн даалгавар 1)"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source_code: embed
theme: yeti
navbar:
- { icon: "fa-facebook", href: "https://www.facebook.com/b.byambadorj0212/",align: right, target: blank}
- { icon: "fa-github", href: "https://github.com/Byambaa212/R_Graphic_Gallery",align: right, target: blank}
---
```{r setup, include=FALSE}
library(readxl)
library(tidyr)
library(highcharter)
data_import <- read_xlsx("data.xlsx", sheet = 3)
data_export <- read_xlsx("data.xlsx", sheet = 4)
data_import_busad <- read_xlsx("data.xlsx", sheet = 5)
data_export_busad <- read_xlsx("data.xlsx", sheet = 6)
data_import <- pivot_longer(data_import, c('2013','2014','2015','2016','2017','2018','2019'),
names_to = "year", values_to = "values")
data_export <- pivot_longer(data_export, c('2013','2014','2015','2016','2017','2018','2019'),
names_to = "year", values_to = "values")
data_import_busad <- pivot_longer(data_import_busad, c('2013','2014','2015','2016','2017','2018','2019'),
names_to = "year", values_to = "values")
data_export_busad <- pivot_longer(data_export_busad, c('2013','2014','2015','2016','2017','2018','2019'),
names_to = "year", values_to = "values")
```
# Экспорт (column) {data-icon="fas fa-chart-line"}
## Column 1 {.active .tabset-fade .tabset-pills}
###
```{r}
data_export %>% hchart("column", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын экспортод эзлэх улсуудын хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
## Column 2 {.active .tabset-fade .tabset-pills}
###
```{r}
data_export_busad %>% hchart("column", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын экспорт бусад улсуудад эзлэх хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
# Импорт (column) {data-icon="fas fa-chart-line"}
## Column 1 {.active .tabset-fade .tabset-pills}
###
```{r}
data_import %>% hchart("column", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын импортодтод эзлэх улсуудын хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
## Column 2 {.active .tabset-fade .tabset-pills}
###
```{r}
data_import_busad %>% hchart("column", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын импорт бусад улсуудад эзлэх хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15)) %>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
# Экспорт (line) {data-icon="fas fa-chart-line"}
## Column 1 {.active .tabset-fade .tabset-pills}
###
```{r}
data_export %>% hchart("line", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын экспортод эзлэх улсуудын хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
## Column 2 {.active .tabset-fade .tabset-pills}
###
```{r}
data_export_busad %>% hchart("line", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын экспорт бусад улсуудад эзлэх хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
# Импорт (line) {data-icon="fas fa-chart-line"}
## Column 1 {.active .tabset-fade .tabset-pills}
###
```{r}
data_import %>% hchart("line", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын импортодтод эзлэх улсуудын хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15))%>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```
## Column 2 {.active .tabset-fade .tabset-pills}
###
```{r}
data_import_busad %>% hchart("line", hcaes(x="year", y="values", group="Country",
style = list(fontFamily = "Times New Roman")))%>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("red","#6ee2ff","#60b6ff","#458cff","blue")) %>%
hc_xAxis( title = list(text = ""),labels = list(rotation = 5),
gridLineColor="#66c5ff", gridLineWidth=0) %>%
hc_yAxis( title = list(text = ""),
labels = list( format = "{value:,.0f}%"),
gridLineColor="#66c5ff", gridLineWidth=1) %>%
hc_plotOptions(column = list(
dataLabels = list(enabled = F),
enableMouseTracking = T )
)%>%
hc_title(text="Монгол улсын импорт бусад улсуудад эзлэх хувь",align="center",
style = list(fontWeight = "bold", fontSize = "20px")) %>%
hc_legend(layout = 'horizontal', align = 'center', verticalAlign = 'bottom',
style = list(fontSize = "100px")) %>%
hc_tooltip(headerFormat = 'Хугацаа {point.key} ',
pointFormat = paste0( '
\u25CF',
" {series.name}: {point.y}%")) %>%
hc_add_theme(hc_theme_economist()) %>%
hc_chart(type="column", options3d = list(enabled = TRUE, beta = 15, alpha = 15)) %>%
hc_credits(
enabled = TRUE,
text = "Эх сурвалж: Дэлхийн банк",
href = "https://wits.worldbank.org/",
target= '_blank',
style = list(fontSize = "10px"))
```