Closed henningsway closed 2 years ago
PS: for some strange reason I couldn't create an apex-chart with the penguins dataset.
# library(palmerpenguins)
# apex(data = penguins,
# type = "scatter",
# mapping = aes(x = bill_length_mm, y = bill_depth_mm))
Can you please help to customize the colors of the lines in this code:
apex(data = dt, type = "line", mapping = aes(x = date, y = value,color=variable)) %>% ax_stroke(width = 2,curve = "smooth")%>% ax_yaxis(title = list(text = ""), labels = list( formatter = htmlwidgets::JS(FUNC_JSFormatNumber) ))%>% ax_grid(borderColor = "#e7e7e7", row = list( colors = c("#f3f3f3", "transparent") ))%>% ax_title( text = "Cumulative COVID-19 Cases", align = "left" )%>% ax_legend(position="top")
@henningsway yes the color management is not great at the moment, they are not actually linked to the data on the JavaScript side. I think we can do something in R to fix that.
The issue with penguins dataset is due to missing value, that's fixed.
@malouche Can you open a new issue with a reproducible example please ? I'll look into it
Check ax_colors_manual()
for that functionnality.
I plan to use your package in a shiny app, where I need to visualize the effects of a variable with many factor levels (20-30). In this context it's important, that the colors for the specific factor levels don't change when some kind of filter or drill down happens.
In ggplot2 this can be achieved by setting
scale_color_discrete(drop = FALSE)
. Is there a similar solution that can be used or implemented in the apexcharter package (potentiallyax_colors(drop = FALSE)
or so)?By the way, the package has been a deligth to use so far! :)
Created on 2020-07-27 by the reprex package (v0.3.0)