Hello Veena,
It might be difficult to answer the question without seeing relevant
parts of the code.
Let me try to give some tips.
Since you are using dataXML method, in your view file, you would create
the xml as follows:
The xml is obtained as a string from builder template.
str_xml = render
:file=>“fusioncharts/db_example/basic_factories_quantity”,:locals=>{:factories
=> @factories}
Here,
fusioncharts/db_example/basic_factories_quantity is the path to the
buider file. basic_factories_quantity.builder is the actual builder’s
filename.
And then use render_chart to render it.
Next, the builder. I assume this part you might already have got it
right.
xml = Builder::XmlMarkup.new
xml.chart(:caption=>‘Factory Output report’, :subCaption=>‘By Quantity’,
:pieSliceDepth=>‘30’, :showBorder=>‘1’, :formatNumberScale=>‘0’,
:numberSuffix=>‘Units’) do
factories.each do |factory|
xml.set(:label=>factory.name,:value=>factory.total_quantity)
end
end
I have generated the xml for FusionCharts v3, you could do similarly for
FusionCharts Free.
Hope this helps you out.
Srividya
Veena J. wrote:
I have been working and found that the problem lies in the builder file
.
Is there any gem required for rendering builder files.
I tried gem install builder (got version 2.1.2)
yet the str_xml is not set…
Help me out…
Veena