Convert value to percent in highchart tooltip

I've made a treemap in high charter and I want to print the value multiplied by 100 and add a percentage symbol on the end. I currently have this code that produces the image below

hchart(dout, type = "treemap")%>%
  hc_tooltip(pointFormat = "<b>{point.name}</b>:<br>
                             value: {point.value:.3f}%<br>")

Untitled

Based on my reading of the high charter documentation, I need to do something like this using a JS script function (but this exact code doesn't produce what I want) :

hchart(dout, type = "treemap")%>%
  hc_tooltip(pointFormat = "<b>{point.name}</b>:<br>",
             formatter = JS("function(){ return point.value * 100 + '%'; }"))

I'm fairly new to R and definitely don't have any experience with JS
I've read this https://api.highcharts.com/highcharts/tooltip.formatter

and this : https://www.highcharts.com/blog/tutorials/working-with-highcharts-javascript-syntax-in-r/?fbclid=IwAR0fZ97iISS1_itErg69A6ncxI8R1JUuLVAzj4V_af7FE9oPkMBIPR3F9-I

and I've searched for examples of how formatter is used but I still don't understand.

Just updating this post. After searching for understanding about how to use a JS function and not getting anywhere I decided just to move upstream in my code and multiply the value that becomes {point.value} by 100. No changes needed to the code block I posted.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.