Ruby on rails 懒惰的高图表宝石和艺术

Ruby on rails 懒惰的高图表宝石和艺术,ruby-on-rails,ruby,charts,highcharts,Ruby On Rails,Ruby,Charts,Highcharts,我使用lazy high charts gem在ruby on rails中生成数据图表。当我尝试使用饼图,在控制器中生成数据,并创建用于调用我的饼图的帮助器时,这是正常的: def pie_chart(data, options={}) chart = LazyHighCharts::HighChart.new('pie') do |f| f.chart({:defaultSeriesType=>"pie", :backgroundColor=>"rgba(255, 2

我使用lazy high charts gem在ruby on rails中生成数据图表。当我尝试使用饼图,在控制器中生成数据,并创建用于调用我的饼图的帮助器时,这是正常的:

def pie_chart(data, options={})
  chart = LazyHighCharts::HighChart.new('pie') do |f|
    f.chart({:defaultSeriesType=>"pie", :backgroundColor=>"rgba(255, 255, 255, 0)"} )
    series = {
             :type=> 'pie',
             :name=> options[:name],
             :data=> data
    }
    f.series(series)
    f.options[:title][:text] = options[:title]
    f.legend(:layout=> 'horizontal')
    f.colors(["#f7941d", "#8dc73f", "#11a99d", "#6ac7ff","#ec217b", "#f03f37"])

    f.plot_options(:pie=>{
      :allowPointSelect=>true,
      :cursor=>"pointer" ,
      :dataLabels=>{
        :enabled=>false,
        :color=>"black",
        :style=>{
          :font=>"13px Trebuchet MS, Verdana, sans-serif"
        }
      },
      :showInLegend => true,
      :point => {
        :events => {
      }}
    })
  end

  html = high_chart(options[:id], chart) do
    if options[:show_absolutes].present?
      raw "
        options.legend.labelFormatter = function() {return '<b> '+ this.name +'</b>: '+ this.y + ' (' + this.percentage.toFixed(2) +' %)';};
        options.tooltip.formatter = function() {return '<b> '+ this.point.name +'</b>: '+ this.y + ' (' + this.percentage.toFixed(2) +' %)';};
      "
    else
     raw "
        options.legend.labelFormatter = function() {return '<b> '+ this.name +'</b>: '+ this.percentage.toFixed(2) +' %';};
        options.tooltip.formatter = function() {return '<b> '+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %';};
      "
    end
  end
但在我看来,当呼叫我的助手时,什么也不会发生。怎么了?懒散的高图表可以创造艺术吗?因为在他的维基上找不到其他的东西

def maps_chart(data, options={})
  chart = LazyHighCharts::HighChart.new('map') do |f|
    f.chart({:defaultSeriesType=>"map"})
    series = {
             :type=> 'map',
             :name=> options[:name],
             :data=> data,
             :mapData => geojson
    }

  end

  high_stock(options[:id], chart) do
  end end