Last active
May 30, 2024 19:47
-
-
Save helgasoft/e914fe6f4a9ed9407f78e41cb18b3aaa to your computer and use it in GitHub Desktop.
echarty announcements and temporary notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' This gist is for echarty announcements and notes | |
#' Comments are temporary, periodically deleted. | |
#' If you like echarty, please consider granting a Github star ⭐. | |
library(echarty) | |
data.frame(x = seq.int(1, 5, 1), | |
y = seq.int(1, 10, 2)) |> | |
ec.init( | |
series.param= list( | |
type='line', symbolSize= 10, | |
lineStyle = list(opacity= 0.7), | |
itemStyle = list(opacity= 1), | |
areaStyle= list(color= 'red', opacity= 0.5)) | |
) |
@joekeane7, symbol coloring could be done with visualMap categories (instead of pieces)
library(echarty); library(dplyr)
ptd_data <- data.frame(
x = seq.Date(from = as.Date("2021-01-01"), by = "month", length.out = 12),
y = rnorm(12, 100, 10),
upl = rnorm(12, 110, 10),
lpl = rnorm(12, 90, 10),
point_type = sample(c("point_type_1", "point_type_2", "point_type_3", "point_type_4"), 12, replace = TRUE)
)
ptd_data |> ec.init(
series.param = list(type='line', name='line', symbolSize=12),
legend= list(show=T),
visualMap= list(
dimension= 5, # R-count
left= "center", bottom= "5%", orient= "horizontal", itemSymbol= "circle",
categories= sort(unique(ptd_data$point_type)),
inRange= list(color= c("grey", "#361475", "#fab428", "#289de0"))
),
tooltip= list(trigger= "axis")
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dynamically defined stacked bars, for @enriquepravia