Create a tuichart htmlwidget

tuichart(
  type = "bar",
  data = NULL,
  options = NULL,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

type

Type of chart.

data

A list of parameters for the data used in the chart.

options

A list of options for the chart.

width

A numeric input in pixels.

height

A numeric input in pixels.

elementId

Use an explicit element ID for the widget.

Value

A tuichart htmlwidget object.

Examples

library(gapminder) library(dplyr)
#> #> Attachement du package : 'dplyr'
#> The following objects are masked from 'package:stats': #> #> filter, lag
#> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union
n_countries <- gapminder_unfiltered %>% filter(year == 2007) %>% count(continent) # a barchart tuichart("column") %>% add_data(n_countries, aes(x = continent, y = n)) %>% tui_series(showLabel = TRUE) # a treemap tuichart("treemap") %>% add_data(n_countries, aes(level1 = continent, value = n)) %>% tui_series(showLabel = TRUE) # a pie chart tuichart("pie") %>% add_data(n_countries, aes(x = continent, y = n)) %>% tui_series(showLabel = TRUE) gdp_italy <- gapminder_unfiltered %>% filter(country == "Italy") # line chart tuichart("line") %>% add_data(gdp_italy, aes(x = year, y = gdpPercap)) %>% tui_chart( title = "A chart", format = "0.00" ) %>% tui_series( zoomable = TRUE ) %>% tui_plot( hideLine = TRUE ) %>% tui_xAxis( tickInterval = "auto", title = "X axis title" )