FusionCharts -Jruby

Hai friends,
I am a newbie in Jruby on Rails…
while using fusion charts i am not able to generate the XML values
using the builder file.I asks for the template for the builder file.
Instead if i give the hard coded values it works fine.It works fine with
ROR. Can u help me?

Thanks,
Veena

On Thu, Mar 18, 2010 at 2:15 AM, Veena J. [email protected]
wrote:

Hai friends,
 I am a newbie in Jruby on Rails…
 while using fusion charts i am not able to generate the XML values
using the builder file.I asks for the template for the builder file.
Instead if i give the hard coded values it works fine.It works fine with
ROR. Can u help me?

Hai!

I think you’ll need to provide more details than that. When it doesn’t
work, what does it do? Can you provide a reproducible case (like a
dummy application) that works in Ruby but not in JRuby? What versions
of JRuby, Rails, and FusionCharts are you using?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I am using the JRuby 1.4.0(windows executable)

I am using the Fusion charts free version. While displaying the chart
using the DATAXML method it requests a .erb template with the name of
the .builder file(i have placed the .builder file in the view folder
itself , should i have place it some where else??) prefixed by a _. If
i create an empty .erb file then i get the “Error in loading data”
error.

If i do execute the same code in Instantrails2.0 it works just fine. It
doesnot ask any any .erb template and load data from database perfectly.

Later i tried giving the the xml values hard coded into str_xml it
works fine.(ie. it is not calling the render method from fusioncharts
helper whereas it displays the chart correctly using render chart
method)

I am not able to attach the code it says too big.

Do help me out . I am struck with it for days

Veena

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs