Skip to content

Instantly share code, notes, and snippets.

@ThoDuyNguyen
Created April 24, 2016 16:29
Show Gist options
  • Save ThoDuyNguyen/8c566510274b59f77ca790bee4a2d81c to your computer and use it in GitHub Desktop.
Save ThoDuyNguyen/8c566510274b59f77ca790bee4a2d81c to your computer and use it in GitHub Desktop.
ChartJS - Test barchart
---
title: "Flex Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
horizontal_layout: fill
---
<!-- Learn more about flexdashboard at https://rstudio.github.io/flexdashboard -->
```{r setup, include=FALSE}
# Load packages and initialize data here
library(flexdashboard)
library(chartjs)
```
Bars Chart
=======================================
```{r}
chartjs() %>%
cjsBar(labels = LETTERS[1:10]) %>%
cjsAddSeries(data = c(abs(c(rnorm(8))), NA, 0.5), label = "Series 1") %>%
cjsAddSeries(data = abs(c(rnorm(10))), label = "Series 2") %>%
cjsAddSeries(data = abs(c(rnorm(10))), label = "Series 3") %>%
cjsLegend()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment