datastorm-open / rAmCharts

API for Amcharts
48 stars 17 forks source link

mainColor when there is only row in input data.frame #64

Closed ThoDuyNguyen closed 7 years ago

ThoDuyNguyen commented 8 years ago

Is it possible to set the color in this case?

test <-
  structure(
    list(label = "0.9", value = 20804L),
    class = "data.frame",
    row.names = c(NA,
    -1L),
    .Names = c("label", "value")
  )

These 2 snippet should produce same pie with different color (in my opinion)

Snippet 1:

amPie(test, legend = TRUE, show_values = FALSE) %>%
  amOptions(mainColor = "#00ff00")

Snippet 2:

amPie(test, legend = TRUE, show_values = FALSE) %>%
  amOptions(mainColor = "#d80036")
TitouanRobert commented 8 years ago

Hi, You can use : test$color <- "#d80036"

amPie(test, legend = TRUE, show_values = FALSE)

mainColor should be use for title color :

amPie(test, legend = TRUE, show_values = FALSE) %>% amOptions(mainColor = "#00ff00", main = "My title")

Regards,