mrjoh3 / c3

c3 HTMLWidget Ploting
39 stars 51 forks source link

Unexpected behaviour for JS events #12

Closed thomasthomasth closed 6 years ago

thomasthomasth commented 6 years ago

Hi,

It looks like this javascript issue is replicated in the latest c3 library available on CRAN.

https://github.com/c3js/c3/issues/2354

In particular, tooltips and mouse events do not trigger with Pie charts - including the default settings.

Once some class is modified in CSS, it works immediately.

Here are two reproducible examples that are supposed to result in the same chart (with hover-events!):

1)

library(shiny) library(c3) ui <- fluidPage( titlePanel("C3 Test"), mainPanel( tags$style(".c3-event-rects { display: none; }"), c3Output("plot1") ) ) server <- function(input, output) { output$plot1 <- renderC3({ data.frame(sugar = 20, fat = 45, salt = 10) %>% c3() %>% c3_pie() }) } shinyApp(ui = ui, server = server)

2)

data.frame(sugar = 20, fat = 45, salt = 10) %>% c3() %>% c3_pie()

mrjoh3 commented 6 years ago

thanks for the heads up. It looks like this was fixed in c3 0.6.4, I updated to use the latest c3js source 0.6.7 and the hover events now work as expected on c3_pie()