I'm pretty new to JavaScript, Ruby, Rails and Highcharts, but I have muddled through well enough to get line and pie charts working using rails 4 and the lazy_high_charts gem version 1.5.0. I can't figure out how to get a bubble chart to appear though. :( I don't see any errors reported in my rails server log (which I think makes sense, since the problems would manifest client side). I can't figure out if there is a client side log. Can anyone point out my no-doubt noob mistake?
Here is my controller code:
bubble_series = [[1,2,3], [4,5,6]]
@chart = LazyHighCharts::HighChart.new('bubble') do |f|
f.title(text: 'Bubbles!')
f.chart(type: 'bubble', zoomType: 'xy', plotBorderWidth: 1)
f.series(
data: bubble_series,
marker: {
fillColor: {
radialGradient: { cx: 0.4, cy: 0.3, r: 0.7 },
stops: [ [0, 'rgba(255,255,255,0.5)'], [1, 'rgba(69,114,167,0.5)'] ]
}
}
)
end
and in my view, its referenced as:
<div class="span8">
<% if @readings.any? %>
<%= high_chart("chart", @chart) %>
<% end %>
</div>
Thanks!!
[Edit] Doh. I figured out which noob thing I did. I failed to include the highcharts-more script on the generated page. It worked once I added this line to the section of my application layout .html.erb file:
<%= javascript_include_tag "highcharts-more" %>
I'll close my question once I'm allowed to (in ~5 hours).
Doh. I figured out which noob thing I did. I failed to include the highcharts-more script on the generated page. It worked once I added this line to the section of my application layout .html.erb file: