Documentation is still a work in progress but closer than ever. If you choose to go with polycharts
(make sure you are aware of paid commercial licensing), then these examples might be helpful. Here is another StackOverflow question on the same topic. I made a quick example below.
library(rCharts)
data(iris)
colnames(iris) <- sapply(colnames(iris), FUN = gsub, pattern = "\\.", replacement = "")
p5 <- rPlot(SepalWidth ~ SepalLength, data = iris, color = "Species", type = "point", height = 400)
# again match polychartjs example exactly to show how we can change axis and legend titles
p5$guides(color = list(scale = "#! function(value){
color_mapping = {versicolor: '#ff2385',setosa:'#229922',virginica:'#2B24D6'}
return color_mapping[value];
} !#"), y = list(title = "sepalWidth"), x = list(title = "sepalLength"))
p5$set(title = "Iris Flowers")
p5
If you choose to use another library, specifying the color will be different, so let me know and I'll be glad to help out.