New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display svg for radarchart #144
Comments
@jgraille, it looks like you are out of luck on this issue, for now. |
Hello @helgasoft , That was one bad approach. I tried to use the radar.axisLabel with the property rich but it is not working. :( Here are some tries: library(shiny)
library(echarts4r)
ui <- fluidPage(
echarts4rOutput("radar"),
echarts4rOutput("radar1"),
echarts4rOutput("radar2")
)
server <- function(input, output, session){
data <- data.frame(
brands = c('github','gitlab','tfs','GitKraken','Git'),
value = c(12,45,23,50,32),
symbol = c("image://https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg",
NA,NA,NA,NA))
output$radar <- renderEcharts4r({
data %>%
e_charts(brands) %>%
e_radar(value,max = 60) %>%
e_radar_opts(axisLabel=list(rich=list(
label=list(formatter='{OneLabel|github}',
rich=list(OneLabel=list(backgroundColor='#00538B')))
)
)
)
})
output$radar1 <- renderEcharts4r({
data %>%
e_charts(brands) %>%
e_radar(value,max = 60, axisLabel=list(
rich=list(
label=list(
formatter="{OneLabel|github}",
rich=list(OneLabel=list(backgroundColor='#00538B'))
)
)
)
)
})
output$radar2 <- renderEcharts4r({
data %>%
e_charts(brands) %>%
e_radar(value,max = 60) %>%
e_labels(list(formatter='{OneLabel|github}',
rich=list(OneLabel=list(backgroundColor='#00538B')
)
)
)
})
}
shinyApp(ui, server) I don't know if the pb comes from my syntax or from the main library. |
@jgraille, Echarts API is very confusing about the rich scope. For instance, it is defined under textStyle, but not under name - probably a mistake. So I incorrectly dismissed the formatter. library(echarts4r)
data <- data.frame(
brands = c('yelp','cloud','twitter_2','glass','mouse'),
values = c(12,45,23,50,32)
)
# build a list for rich formatting
rifo <- lapply(data$brands, function(x) {
list(height = 30,
backgroundColor=list(image=paste0('http://simpleicon.com/wp-content/uploads/',x,'-64x64.png')))
})
names(rifo) <- data$brands
data %>%
e_charts(brands) %>%
e_radar(values, max=60, legend=FALSE) %>%
e_radar_opts(
name = list(formatter = htmlwidgets::JS("
function(value){ return '{' + value + '| }'; } "),
rich = rifo)
) |
Hi @helgasoft , |
Solved. |
@helgasoft Please any idea how a picture can be added to the Some tries: library(echarts4r)
data <- data.frame(
brands = c('yelp','cloud','twitter_2','glass','mouse'),
values = c(12,45,23,50,32)
)
# build a list for rich formatting
rifo <- lapply(data$brands, function(x) {
list(height = 30,
backgroundColor=list(image=paste0('http://simpleicon.com/wp-content/uploads/',x,'-64x64.png')))
})
names(rifo) <- data$brands
logo = list(height = 30, backgroundColor = list(image = "http://simpleicon.com/wp-content/uploads/mouse-64x64.png"))
data %>%
e_charts(brands) %>%
e_radar(values, max=60, legend=FALSE) %>%
e_radar_opts(
name = list(formatter = htmlwidgets::JS("
function(value){ return '{' + value + '| }'; } "),
rich = rifo)) %>%
e_title(text = "", textStyle = list(fontStyle = "italic",
rich = list(label = list(formatter = htmlwidgets::JS("
function(value){ return '{' + value + '| }'; } "), rich = logo)))) Thanks for any ideas... |
Solved!
|
Hello,
I would like to use svg files to display as axis values in a radar chart. I tried to refer to this
https://echarts.apache.org/examples/en/editor.html?c=bar-rich-text without success.
I used
e_axis(formatter=htmlwidgets::JS("function (symbol) { return '{' + symbol + '}';"))
Here's an exemple:
The text was updated successfully, but these errors were encountered: