Hello guys i am creating r shiny dashboard,
I want to add color shade like heat map.
I go with this link reference 3 Style A Full Table but dont know how to use it in my code with blue color.
showRecordColumns <- c('Supplier','# Parts at Risk' , 'DAM Score', 'REL Score', 'AGI Score', 'RES Score')
SDRMSketch = htmltools::withTags(table(
class = 'table table-striped table-hover',
thead(
tr(
th(colspan = 1, ' '),
th(colspan = 2, 'Buyer: Suilian', class="sdrm-table-head-buyer"),
th(colspan = 3, 'Risk Matrix', class="sdrm-table-head-risk-matrics")
),
tr(
lapply(showRecordColumns, th)
)
)
))
output$SDRM <- DT::renderDataTable(DT::datatable(merged[,showRecordColumns],
container = SDRMSketch,
rownames = FALSE,
extensions = 'Buttons',
callback=JS('$(".buttons-csv").addClass("btn btn-inline btn-dark-outline"); return table;'),
options = list(
paging = TRUE,
searching = TRUE,
fixedColumns = TRUE,
autoWidth = TRUE,
ordering = TRUE,
dom='Bftrip',
buttons = list(
list(extend = "csv",
text = "Download Current Page",
filename = "SDRM_page",
class = "btn",
exportOptions = list(
modifier = list(page = "current")
)
),
list(extend = "csv", text = "Download Full Results", filename = "SDRM_data",
exportOptions = list(
modifier = list(page = "all")
)
)
)
)
) %>% formatRound(c(3:6), 2)
%>% formatStyle(c(2), background = styleColorBar(range(0:100), 'lightblue'))
)
}
Current data table result displayed like
Apply color range on only last four column and lower value higher color density. Want to represent lower value means danger.
Expected Result should be like this.