FrissC3BarChart: Friss C3 BarChart

Description Usage Examples

View source: R/FrissC3Charts.R

Description

Friss custom c3.js HTMLWidget output binding

Usage

1
2
3
4
5
FrissC3BarChart(Data = data.frame(suspected = c(10, 8, 11), investigated =
  c(6, 9, 1), suspicious = c(7, 9, 12), proven = c(2, 3, 25), row.names =
  c("actual", "planned", "average")), yUnit = "", width = "100%",
  height = "500px", padding = list(top = 40, right = 100, bottom = 40, left
  = 100), rotated = FALSE, legend_show = TRUE, legend_position = "bottom")

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
30
app <- shinyApp(

ui = fluidPage(
  actionButton("Update","Update"),
  FrissC3BarChartOutput("Chart")
),

server = function(input, output) {
  output$Chart <- renderFrissC3BarChart({

    cat("\nUpdate")
    input$Update
    Data <- data.frame(suspected = runif(3,8,11), investigated =
                         c(6, 9, 1), suspicious = c(7, 9, 12), proven = c(2, 3, 25), row.names =
                         c("actual", "planned", "average"))

    # make number of columns data change
    if(input$Update %% 2 == 0) Columns <- 2:3
    else Columns <- 1:3

    Data    <- Data[,Columns]

    FrissC3BarChart(Data = Data, yUnit = "", width = "100%",
                    height = "500px", padding = list(top = 40, right = 100, bottom = 40, left
                                                     = 100), rotated = FALSE, legend_show = TRUE, legend_position = "bottom")
  })
}
)

runApp(app)

ttraboue/FrissC3 documentation built on May 17, 2019, 8:17 a.m.