我无法在 wicked pdf 中生成 LazyHighCharts。
控制器:
class GeneratepdfsController < ApplicationController
layout false
def index
@test = "hey"
@bar = LazyHighCharts::HighChart.new('column') do |f|
f.series(:name=>'John',:data=> [3, 20, 3, 5, 4, 10, 12 ])
f.series(:name=>'Jane',:data=>[1, 3, 4, 3, 3, 5, 4,-46] )
f.title({ :text=>"example test title from controller"})
## or options for column
f.options[:chart][:defaultSeriesType] = "column"
f.plot_options({:column=>{:stacking=>"percent"}})
render :pdf => "file.pdf", :template =>'generatepdfs/index.html.erb'
end
end
视图:index.html.erb
<%= high_chart("my_bar_div", @bar) %>
<p><%= @test %></p>
结果:字符串“hey”出现在 PDF 中,但图表没有出现,我不知道为什么。