FusionCharts Forum: Invalid XML Data - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Invalid XML Data

#1 User is offline   amairme 

  • Forum Newbie
  • Group: Members
  • Posts: 1
  • Joined: 26-November 08

Posted 26 November 2008 - 03:02 PM

I'm trying the FusionCharts Basic Database Example but i'm getting an error Invalid XML Data

Rails -v 2.1.1

here is my code:

<% @page_title="FusionCharts - Database Example" %>

<% @page_heading="FusionCharts Database Example Using dataXML method" %>

<% @page_subheading="Click on any pie slice to slice it out. Or, right click to enable rotation mode." %>

<%str_xml = render "process_utilizations/basic_factories_quantity",{:factory_data => @factory_data}

render_chart '/FusionCharts/Pie3D.swf', '', str_xml, 'FactorySum', 600, 300, false, false do-%>

<% end-%>

-------------------------

xml = ::Builder::XmlMarkup.new

xml.chart(:caption=>'Factory Output report', :subCaption=>'By Quantity', :pieSliceDepth=>'30', :showBorder=>'1', :formatNumberScale=>'0', :numberSuffix=>'Units') do

for item in factory_data

xml.set(:label=>item[:factory_name],:value=>item[:factory_output])

end

end

--------------------------

def basic_dbexample

headers["content-type"]="text/html";

@factory_data = []

factory_masters = FactoryMaster.find(:all)

factory_masters.each do |factory_master|

total = 0

factory_id = factory_master.id

factory_name = factory_master.name

factory_master.factory_output_quantities.each do |factory_output|

total += factory_output.quantity.to_i

end

@factory_data<<{:factory_name=>factory_name,:factory_output=>total}

end

end

---------------------
0

Other Replies To This Topic

#2 User is offline   srividya_sharma 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 943
  • Joined: 01-October 07

Posted 17 December 2008 - 10:55 PM

The statement in the builder:

for item in factory_data

implies that the factory_data has to be sent as parameter to the builder. I hope that you are passing this value from basic_dbexample.html.erb

regards,
Srividya Sharma
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic