在div顶部的Highchart馅饼

时间:2014-12-05 16:42:26

标签: ruby-on-rails highcharts lazy-high-charts

我正在使用rails gem(lazy_high_charts)来帮助将属性传递给由highcharts提供支持的饼图。我希望饼图从div的顶部开始。目前,div的顶部和饼图的开头之间有很多空间。我使用了spacerTop = 0并且没有取得任何成功。

Img of space I want removed

此代码如下所示:

@chart = LazyHighCharts::HighChart.new('pie') do |f|
  f.chart({:defaultSeriesType=>"pie", :backgroundColor=>"transparent", :margin=>[10, 10, 10, 10], 
                             :spacingTop=>0, :spacingBottom=>0, :spacingLeft=>0, :spacingRight=>0})
  series = {
            :type=> 'pie',
            :name=> '$',
            :data=> [
               ['Lent',   @account.Available_Cash_Balance__c],
               ['Available Funds',   @account.Total_Pledged__c],
               ['Pledged',   100000]
            ]
  }
  f.series(series)
  f.legend(:layout=> 'vertical', :itemMarginTop=>0, :itemMarginBottom=>0)
  f.plot_options(:pie=>{
       :allowPointSelect=>true, 
       :cursor=>"pointer",
       :showInLegend=>true,
       :dataLabels=>{
       :enabled=>false
  }
  })
end 

0 个答案:

没有答案