JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
587 stars 82 forks source link

e_tooltip formatter recognising strings like label formatter #515

Closed Mkranj closed 10 months ago

Mkranj commented 1 year ago

When making a bar chart, I can use code like the following:

e_bar(y,
              label = list(show = T,
                           formatter = "{@y}%",
                           position = "top")
)

And the value I want will be printed exactly how I want it. However, in e_tooltip, passing a string to the formatter option doesn't seem to do anything. I've tried passing Javascript code, but I'm never sure what variables I'm dealing with, for example, if my chart includes multiple calls to e_bar, e_area and such. Can a simple string based formatter be implemented for tooltips? The text on hover is surprisingly non-customiseable compared to most other things in the package. The amount of options present for most things is why I've started using it in the first place :)

munoztd0 commented 10 months ago

We are sorry but we not going to implement a simple string based formatter for now.

But don't hesitate to ask question on how to create integrate your javascript code..