Description Usage Arguments Examples
Easily converts an element's content into a svg mini pie, donut, line or bar chart.
Peity function is a wrapper around peity.js and it is compatible with any browser
that supports svg: Chrome, Firefox, IE9+, Opera, Safari. You can use peity()
and specify
the chart or use the chart name function. Ex.: peity(c(1, 2, 3), type = "bar")
is similar
to bar(c(1, 2, 3))
.
1 2 3 4 5 6 7 8 9 | peity(data, type = "bar", width = NULL, height = NULL, elementId = NULL, ...)
bar(data, width = NULL, height = NULL, elementId = NULL, ...)
line(data, width = NULL, height = NULL, elementId = NULL, ...)
pie(data, width = NULL, height = NULL, elementId = NULL, ...)
donut(data, width = NULL, height = NULL, elementId = NULL, ...)
|
data |
A vector specifying the values to the chart. |
type |
A string specifying the chart. The options are: "bar", "line", "pie" or "donut". |
width |
The chart width. The package already adjusts the chart to the line. Use it if you want a specific width. |
height |
The chart height. The package already adjusts the chart to the line. Use it if you want a specific height. |
elementId |
A string with the elementId. The package already generates this and you don't need to worry. Use this parameter if you need to pass a specific elementId. |
... |
A list of specific options to hte chart. See details in https://benpickles.github.io/peity/. |
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.