# Problems with using Open Flash Charts library

**URL:** <https://www.ruby-forum.com/t/problems-with-using-open-flash-charts-library/127790>\
**Category:** Rails\
**Created:** [February 1, 2008, 11:03am UTC](https://www.ruby-forum.com/t/problems-with-using-open-flash-charts-library/127790 "2008-02-01T11:03:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://www.ruby-forum.com/u/antonk)\
**Post date:** [February 1, 2008, 11:03am UTC](https://www.ruby-forum.com/t/problems-with-using-open-flash-charts-library/127790/1 "2008-02-01T11:03:47Z")

</div>

Hi.  
I have download OpenFlashCharts library for RubyonRails.  
And when I try to make a chart a have problem with data for this chart  
code samples from examples which are on this web-site are’nt working  
[http://pullmonkey.com/projects/open\_flash\_chart](http://pullmonkey.com/projects/open_flash_chart)

for example

def piechart  
@graph = open\_flash\_chart\_object(500,250, ‘/projects/pie’, false,  
‘/projects/’)  
end  
def pie  
data = []  
5.times do |t|  
data \<\< rand(10) + 5  
end

```
    g = Graph.new
    g.pie(60, '#505050', '#000000')
    g.pie_values(data, %w(IE FireFox Opera Wii Other))
    g.pie_slice_colors(%w(#d01fc3 #356aa0 #c79810))
    g.set_tool_tip("#val#%")
    g.title("Pie Chart", '{font-size:18px; color: #d01f3c}' )
    render :text => g.render
end

```

end

dont draw me a chart but when I put data for chart to  
/projects/pie/newfile  
this script draw me chart  
but problem is in that data must be generated automatically without  
putting data in another file.

Thanks for replies.
