View source: R/valueBoxSpark.R
valueBoxSpark | R Documentation |
Modified version of bs4Dash::valueBox()
valueBoxSpark( value, unit = "", selected = NA, title = "", subtitle = "", info = NULL, sparkobj = NULL, type = NA, icon = NULL, color = "light", width = 4, href = NULL )
value |
The value to display in the box. Usually a number or short text. |
unit |
display unit |
selected |
selected |
subtitle |
Subtitle text. |
info |
tooltip information text |
sparkobj |
(optional) highcharts object |
type |
(optional) type of spark chart (line, column, etc.) default to NA (no sparkline) if not passed |
icon |
An icon tag, created by |
color |
The color of the item. This determines the item's background color. Valid colors are defined as follows:
|
width |
The width of the box, using the Bootstrap grid system. This is
used for row-based layouts. The overall width of a region is 12, so the
default width of 4 occupies 1/3 of that width. For column-based
layouts, use |
href |
An optional URL to link to in the footer. Should both 'footer' and this parameter be set, 'footer' will take precedence. |
data |
(optional) data.table to summarize with at least columns |
data <- data.table( x = Sys.Date() + 0:9, y = rnorm(10) ) valueBoxSpark(data, title="Title", subtitle="Subtitle", color="success", type="line") data <- DATA[iso3=="ken" & id=="net_inflow" & period=="year", .(year, value)] valueBoxSpark(data, title="Title", subtitle="Subtitle", color="success", type="bar", unit="km3") valueBoxSpark(33, title="Title", subtitle="Subtitle", color="success", unit="km3", footer="Footer")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.