%script{:type => "text/javascript"}
  :plain
    $(function () {

        $('#chart_div').highcharts({
            chart: {
                type: 'funnel',
                marginRight: 100
            },
            title: {
                text: 'Sales funnel',
                x: -50
            },
            plotOptions: {
                series: {
                    dataLabels: {
                        enabled: true,
                        format: '<b>{point.name}</b> ({point.y:,.0f})',
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                        softConnector: true
                    },
                    neckWidth: '50%',
                    neckHeight: '25%'

                    //-- Other available options
                    // height: pixels or percent
                    // width: pixels or percent
                }
            },
            legend: {
                enabled: false
            },
            series: [{
                name: 'Total pounds',
                data: #{@pyramid}
            }]
        });
    });


= "Opportunities Reports"

= column_chart @stacked_chart, stacked: true, library: {title: "#{Date.today.year} Monthly Bags in Pipeline"}

= pie_chart @total_weighted_by_user, library: {pieSliceText: "value-and-percentage", pieSliceTextStyle: {fontSize: "9"}, title: "Total Bags in Pipeline - #{Opportunity.sum_weighted_amount}" }

%div{id: 'chart_div'}

= column_chart @total_monthly_opps, library: {title: "#{Date.today.year} Total Bags Monthly Pipeline"}
%script{:type => "text/javascript"}
  :plain
    $(function () {

      Highcharts.setOptions({
        lang: {
        thousandsSep: ','
        }
      });
        $('#chart_div').highcharts({
            chart: {
                type: 'funnel',
                marginRight: 100
            },
            title: {
                text: 'Sales funnel',
                x: -50
            },
            plotOptions: {
                series: {
                    dataLabels: {
                        enabled: true,
                        format: '<b>{point.name}</b> ({point.y:,.0f} lbs)',
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                        softConnector: true
                    },
                    neckWidth: '50%',
                    neckHeight: '25%'

                    //-- Other available options
                    // height: pixels or percent
                    // width: pixels or percent
                }
            },
            tooltip: {
              valueSuffix: " lbs"
            },
            legend: {
                enabled: false
            },
            series: [{
                name: 'Total pounds',
                data: #{@pyramid}
            }]
        });
    });


= "Opportunities Reports"

= column_chart @stacked_chart, stacked: true, library: {title: "#{Date.today.year} Monthly Bags in Pipeline"}

= pie_chart @total_weighted_by_user, library: {pieSliceText: "value-and-percentage", pieSliceTextStyle: {fontSize: "9"}, title: "Total Bags in Pipeline - #{Opportunity.sum_weighted_amount}" }

%div{id: 'chart_div'}

= column_chart @total_monthly_opps, library: {title: "#{Date.today.year} Total Bags Monthly Pipeline"}
Add lbs suffix to highchart.
Add lbs suffix to highchart.
