Titles can be added thanks to the cjsTitle function:
chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsTitle(title = "mpg and qsec")chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsTitle(title = "mpg and qsec", position = "bottom")chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsTitle(title = "mpg and qsec", fontColor = "#FF00FC", fontFamily = "Times", fontSize = 15, fontStyle = "bold", padding = 20)Legends can be added thanks to the cjsLegend function:
chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsLegendClicking on a legend box removes this dataset from the plot.
chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsLegend(position = "bottom")chartjs(mtcars[1:10,], mpg, qsec) %>%
cjsBar %>%
cjsLegend(labels = list(boxWidth = 15, fontColor = "#FF00FC", fontFamily = "Times", fontSize = 15, fontStyle = "bold", padding = 20))