Description Usage Arguments Details Examples
Make Peity in-line chart
1 2 |
values |
values to plot. |
type |
type of chart defaults to |
options |
|
width, height |
Must be a valid CSS unit (like |
elementId |
|
Valid values for type
:
pie
donut
bar
line
Valid options by type
:
pie: delimiter
, fill
, height
, width
, radius
donut: same as ie (above) + innerRadius
line: delimiter
, fill
, height
, width
, max
, min
, stroke
, strokeWidth
bar: delimiter
, fill
, height
, wdith
, max
, min
, padding
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.