quinta-feira, 4 de fevereiro de 2010

PDF::Writer + Google Charts



PDF with ruby - PDF::Writer (tutorial)



  1. report = GoogleChart.new


  2. report.type = :bar_vertical_grouped


  3. report.height = 350


  4. report.width = 600


  5. report.colors = '346090'


  6. report.title = 'Pay+Back'


  7. report.data = total_dist_mensal


  8. report.data = [459,458,458,453,453,442,442,442,442,442,442,1641]


  9. report.data = [10,20,40,30,10,30,10,10,10,10,10,10]


  10. report.labels = (1..12).to_a


  11. report.eixos = 'x,y'


  12. report = URI.escape(a.to_url)


  13. @pdf.add_image_from_file( a , 60, 10)

Nenhum comentário:

Postar um comentário