jackolney / CascadeDashboard

Shiny app for interactive HIV care cascade model https://jackolney.shinyapps.io/CascadeDashboard
https://jackolney.github.io/CascadeDashboard/
0 stars 0 forks source link

Move away from ggplot2 to interactive JS charts #8

Open jackolney opened 7 years ago

jackolney commented 7 years ago

Perhaps using: http://jkunst.com/highcharter/

Maybe need a static ggplot2 backup system for LaTeX!?

jackolney commented 7 years ago
# Test with highcharter
require(highcharter)
# lets try a basic 90-90-90 thing

indicator <- c("First 90", "Second 90", "Third 90")
value <- c(0.74, 0.86, 0.85)

test <- data.frame(indicator, value)

hchart(object = test,
    type = "column",
    hcaes(x = indicator, y = value)) %>%
    hc_xAxis(title = list(text = "UNAIDS Targets", 
                          style = list(fontSize = "20px")),
             labels = list(style = list(fontSize = "18px"))) %>%
    hc_yAxis(title = list(text = "Perentage", 
                          style = list(fontSize = "20px")),
             labels = list(formatter = JS("function() {
                            return this.value*100+'%';
                           }"),
                           style = list(fontSize = "18px")
                          )
            )

# its just wrappers around JSON... urgh