3
有谁知道如何缩小这个饼图的尺寸?我正在使用Lazy High Charts gem。HighCharts:缩小图表的尺寸
return LazyHighCharts::HighChart.new('pie') do |f|
f.chart({:defaultSeriesType=>"pie" , :margin=> [0, 0, 0, 0], backgroundColor: "#F5F5F5", renderTo: "mediamix#{akid.to_s}"})
f.series({:type=> 'pie', :name=> "Count",:data=> data_val, borderWidth: 0})
f.title({ :text=> nil})
f.plot_options({:pie=>{:allowPointSelect=>true, :cursor=>"pointer" , dataLabels: {enabled: true}, showInLegend: false}})
end
我生成的DIV ID动态,你可以看到(mediamix#{} akid.to_s)......因此我不能风格这是样式表中未知的ID。该ID正在使用high_chart命令= high_chart(“mediamix#{f.id.to_s}”,Gakie.pie(f.id)) – Pykih 2013-03-26 16:00:11
找到解决方案。你是对的。 – Pykih 2013-03-26 16:04:06
你必须以某种方式给div一个大小。要么给它一个类,设置它的高度/宽度属性,或者使用javascript/jquery修改它的大小。 – SteveP 2013-03-26 16:04:34