I work with ruby on rails and use lazy_high_charts_gem to create highstock chart.
I have to set text to the tooltip by sending string with JS function to the highstock api.
I wrote code (as I saw in the gem example):
<%require 'lazy_high_charts' %>
<%= high_stock("my_id", @h) do |c| %>
<%= "options.tooltip.formatter = function() {return 'This is text and this is <b>bold</b>!'; }" %>
<%end %>
the tooltip text realy change but the html tags (in the example B) are part of the text.
do you know what can I do?
This is happening because Rails 3 escapes all view strings by default, whereas rails 2 left them raw by default.
The trick here is to get that formatter line rendered raw:
In the standard rails idiom:
More good info on Rails HTML escape practices here:
https://stackoverflow.com/a/3906207/1195261