peity: Peity

Description Usage Arguments Details Examples

Description

Make Peity in-line chart

Usage

1
2
peity(values, type = "pie", options, width = NULL, height = NULL,
  elementId = NULL)

Arguments

values

values to plot.

type

type of chart defaults to pie, see details for valid values.

options

list of options, see details.

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

elementId

string id as a valid CSS element id.

Details

Valid values for type:

Valid options by type:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
peity("1/5", type = "pie")
peity(c(1,5), type = "donut", options = list(fill = I(c("green", "red")),
                                         radius = 100))
peity(c(1,5), type = "donut", options = list(fill = c("#845422", "#ead61c"),
                                         radius = 50, innerRadius = 40))
peity(rnorm(50, 2, 1), type = "line", options = list(width = 100))
peity(c(1,5,3), type = "bar", options = list(fill = I("green")))

peity(c(4,-2,3, -4), type = "bar", options = list(fill = htmlwidgets::JS('function(value) {
   return value > 0 ? "green" : "red"
}')))
   
js_fun <- htmlwidgets::JS('function(_, i, all) {
    var g = parseInt((i / all.length) * 255)
    return "rgb(255, " + g + ", 0)"
}')
    
peity(c(0,-3,-6,-4,-5,-4,-7,-3,-5,-2), type = "bar", options = list(fill = js_fun))

## End(Not run)

JohnCoene/peity documentation built on June 3, 2019, 2:08 a.m.