echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

Legend interactivity change due to tooltip formatter

Open ddrogen opened this issue 3 years ago • 0 comments

Many thanks for the package! I used this example (https://github.com/JohnCoene/echarts4r/issues/4) in my line chart with 3 categories (doing bind=percentage_label), but the legend interactivity is not working. If I leave e_tooltip(trigger="axis"), I am able to un-click the legend to see the desire series, but I lose my label in percentage. Why inserting JS into the tooltip lead to that behavior?.

e_tooltip(formatter = htmlwidgets::JS("
    function(params){
      return('</strong> Year-Month: ' + params.value[0] + '<br /> RC_Rate: ' + params.name)}"), 
            textStyle=list(fontFamily="Arial", fontSize=12))

versus

e_tooltip(trigger="axis")

Thanks!

ddrogen avatar Aug 30 '22 22:08 ddrogen