pieChart: A simple circular diagram item

Description Usage Arguments Author(s) Examples

View source: R/useful-items.R

Description

https://github.com/rendro/easy-pie-chart

Usage

1
2
3
pieChart(id, value, height = 220, width = 220, barColor = "#ef1e25",
  trackColor = "#f2f2f2", scaleColor = "#dfe0e0", scaleLength = 5,
  lineCap = "round", lineWidth = 3, rotate = 0)

Arguments

id

Unique id.

value

Item value

height

Canvas height. 220 px by default.

width

Canvas width. 220 px by default.

barColor

Default: #ef1e25. The color of the curcular bar. You can either pass a valid css color string, or a function that takes the current percentage as a value and returns a valid css color string.

trackColor

Default: #f2f2f2. The color of the track, or false to disable rendering.

scaleColor

Default: #dfe0e0. The color of the scale lines, false to disable rendering.

scaleLength

Default: 5. Length of the scale lines (reduces the radius of the chart).

lineCap

Default: 'round'. Defines how the ending of the bar line looks like. Possible values are: butt, round and square.

lineWidth

Default: 3. Width of the chart line in px.

rotate

Default: 0. Rotation of the complete chart in degrees.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if (interactive()) {
 library(shiny)
 library(gentelellaShiny)
 shinyApp(
  ui = gentelellaPageCustom(
   gentelellaBody(
    box(
      title = "pieChart",
      "If you've decided to go in development mode and
      tweak all of this a bit, there are few things
      you should do.",
      pieChart(id = "chart1", value = 10),
      pieChart(
       id = "chart2",
       value = 20,
       barColor = "#0000FF",
       trackColor = "#FFA500",
       scaleColor = "#dfe0e0",
       scaleLength = 10,
       lineCap = "square",
       lineWidth = 6,
       rotate = 180
      )
     )
    )
  ),
  server = function(input, output, session) {}
 )
}

MarkEdmondson1234/gentelellaShiny documentation built on Dec. 31, 2019, 1:24 a.m.