Skip to content
michelson edited this page Apr 15, 2013 · 1 revision

##controller

@funnel_chart = LazyHighCharts::HighChart.new('graph') do |f|
  f.chart(type: "funnel", marginRight: 100)
  f.title({ text: 'Sales funnel', x: -50})
  f.plotOptions( series: {
                  dataLabels: {
                      enabled: true,
                      format: '<b>{point.name}</b> ({point.y:,.0f})',
                      color: 'black',
                      softConnector: true},
                  neckWidth: '30%',
                  neckHeight: '25%'
                })
  f.legend( { enabled: false })
  f.series( name: 'Unique users',
            data: [
                  ['Website visits',   15654],
                  ['Website visits bounces', 6954],
                  #['Downloads',       4064],
                  ['View contact info', 1987],
                  ['Requested info', 987]
                ]
          )

view

= high_chart "funnel_chart", @funnel_chart

= content_for :javascript do
 = javascript_include_tag :highcharts
 = javascript_include_tag "highcharts/modules/funnel"
Clone this wiki locally