title: How to add Onclick event to c3 chart in Shiny, R?
body: <p>I want to add onclick event to c3.js chart in Shiny R. I`v read this <a href="https://shiny.rstudio.com/articles/js-send-message.html" rel="nofollow noreferrer">article with c3 examples</a> and try to do some simple app with print in console when clicked on chart. 
  But in my case, onclick I have
  <a href="https://i.stack.imgur.com/6R63A.png" rel="nofollow noreferrer">this error in console</a>. Could you, please, say what I do wrong?  </p>
  
  <pre><code>    ##devtools::install_github("mrjoh3/c3")
      library(c3)
      library(shiny)
  
      shinyApp(
          ui = fluidPage(
              c3Output("c3test")
          ),
          server = function(input, output, session) {
            output$c3test &lt;- renderC3({
              pie.chart &lt;- data.frame(sugar=20,fat=45,salt=10) %&gt;% 
                c3(onclick="function(d,element) {
                   console.log(d.id);
            }") %&gt;% 
                      c3_donut()
          })
          }
      )
  </code></pre>