Learn R Programming

gentelellaShiny (version 0.1.0)

pieChart: A simple circular diagram item

Description

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

Usage

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.

Examples

Run this code
# NOT RUN {
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) {}
 )
}

# }

Run the code above in your browser using DataLab