echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

tootlip overflows for large texts

Open shahreyar-abeer opened this issue 3 years ago • 2 comments

The tooltip does not seem to respond to screen sizes and for large texts, it gets cut off.

library(shiny)
library(echarts4r)



ui <- fluidPage(
  echarts4rOutput("plot"),
)

server <- function(input, output, session){
  
  text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque tellus urna, placerat in tortor ac, imperdiet sollicitudin mi.
Integer vel dolor mollis, feugiat sem eu, porttitor elit."
  
  data <- data.frame(x = rnorm(10, 5, 3), y = rnorm(10, 50, 12), tooltip = text)
  
  
  output$plot <- renderEcharts4r({
    data |> 
      e_charts(x) |> 
      e_line(y, bind = tooltip) |>
      e_tooltip(
        textStyle = list(width = 50, overflow = "truncate"), # does not seem to work
      )
  })
  
  
}

shinyApp(ui, server)

image

Could you please guide me towards a solution? Oh fantastic work by the way! Greatly appreciated.

shahreyar-abeer avatar Jan 04 '22 06:01 shahreyar-abeer

This seems to be a bug in Echarts (see last comment)

etiennebacher avatar Jan 21 '22 17:01 etiennebacher

I see, Thanks for pointing that out. So there's nothing to do than just wait I guess?

shahreyar-abeer avatar Jan 24 '22 05:01 shahreyar-abeer