PDF with ruby - PDF::Writer ( tutorial ) report = GoogleChart. new report. type = :bar_vertical_grouped report. height = 350 report. width = 600 report. colors = '346090' report. title = 'Pay+Back' report. data = total_dist_mensal report. data = [ 459 , 458 , 458 , 453 , 453 , 442 , 442 , 442 , 442 , 442 , 442 , 1641 ] report. data = [ 10 , 20 , 40 , 30 , 10 , 30 , 10 , 10 , 10 , 10 , 10 , 10 ] report. labels = ( 1 .. 12 ) . to_a report. eixos = 'x,y' report = URI . escape ( a. to_url ) @pdf . add_image_from_file ( a , 60 , 10 )