I am using a rails gem (lazy_high_charts) to help pass attributes to a pie chart powered by highcharts. I want the pie chart to start at the top of a div. Currently, there is a lot of space between the top of the div and the beginning of the pie chart. I have used spacingTop=0 and haven't had any success with that.
The code for this looks like the following:
@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