open flash chart help needed

Posted by Carlos Barbosa on Stack Overflow See other posts from Stack Overflow or by Carlos Barbosa
Published on 2009-11-20T06:12:30Z Indexed on 2010/06/02 8:03 UTC
Read the original article Hit count: 260

def reparto_de_ventas_por_marca

#obtener los montos de las ventas en el periodo comprendido y sumarlas


       @ventas = Venta.find(:all)
       @marcas = Marca.find(:all)



        title = Title.new("Ingresos de este mes: #{@total}")

           pie = Pie.new
           pie.start_angle = 35
           pie.animate = true
           pie.tooltip = '#val# de #total#<br>#percent# de 100%'
           pie.colours = ["#245a9c", "#fff"]

 pie.values  = [



    @marcas.each do |result|

     PieValue.new(result.ventas.count, result.name)


  end  



   ]
           chart = OpenFlashChart.new
           chart.title = title
           chart.add_element(pie)

           chart.x_axis = nil

           render :text => chart.to_s
end

It just doesn't works i need to get the values to create a graph with flash chart.

any help will be appreciated.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about open-flash-chart