Skip to content

Instantly share code, notes, and snippets.

@helgasoft
Last active February 19, 2022 18:08
Show Gist options
  • Save helgasoft/63f1b16d9632bfdb6f21f2db80910f47 to your computer and use it in GitHub Desktop.
Save helgasoft/63f1b16d9632bfdb6f21f2db80910f47 to your computer and use it in GitHub Desktop.
R | ECharts | logo, title and background, CORS issues
library(echarty)
radial_gradient <- htmlwidgets::JS(
"new echarts.graphic.RadialGradient(0.3, 0.3, 0.8)"
# ,[{ offset: 0, color: 'red'}, { offset: 1, color: 'red'}])"
)
color_stops <- htmlwidgets::JS(
"[{ offset: 0, color:'gold' }, // color at 0%
{ offset: 0.5, color:'MediumSlateBlue' }, // color at 50%
{ offset: 1, color:'skyblue' // color at 100%
}]"
)
ec.init(title=list(
text='{a| } {b|🢀 here is the logo}',
textStyle = list(
rich=list(
a= list(height=30, backgroundColor=list(
image='http://simpleicon.com/wp-content/uploads/glass-64x64.png')),
b= list( color='teal', fontSize= 24, fontWeight= 400))
) ),
backgroundColor = list(type = "radial",
x = 0.5, y = 0.5, r = 0.5,
backgroundColor = radial_gradient,
colorStops = color_stops )
)
@benubah
Copy link

benubah commented Nov 19, 2021

Good news! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment