Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 带rails的amcharts-不获取数据馈送_Ruby On Rails_Xml_Amcharts - Fatal编程技术网

Ruby on rails 带rails的amcharts-不获取数据馈送

Ruby on rails 带rails的amcharts-不获取数据馈送,ruby-on-rails,xml,amcharts,Ruby On Rails,Xml,Amcharts,我目前的工作如下: 我很容易地完成了这一切,但是当查看带有图表的页面时,它(在flash中)加载了一个黑色矩形,其中包含错误: “加载文件时出错” 评论中有人说这可能与XMLBuilder文件中的代码有关 xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" xml.chart do # xml.message "You can broadcast any message to chart from data

我目前的工作如下:

我很容易地完成了这一切,但是当查看带有图表的页面时,它(在flash中)加载了一个黑色矩形,其中包含错误:

“加载文件时出错”

评论中有人说这可能与XMLBuilder文件中的代码有关

  xml.instruct!  :xml, :version=>"1.0", :encoding=>"UTF-8"
  xml.chart do
    # xml.message "You can broadcast any message to chart from data XML file", :bg_color => "#FFFFFF", :text_color => "#000000"
    xml.series do    
      @cities.each_with_index do |city, index|
        xml.value city.name,  :xid => index
      end
    end

    xml.graphs do
     #the gid is used in the settings file to set different settings just for this graph
      xml.graph :gid => 'population' do
        @cities.each_with_index do |city, index|
          population = city.population
          case population
            # When the population is > 1 million, show the bar in red/pink
            when > 100000
              xml.value value,  :xid => index, :color => "#ff43a8", :gradient_fill_colors => "#960040,#ff43a8", :description => level
            else
              xml.value value,  :xid => index, :color => "#00C3C6", :gradient_fill_colors => "#009c9d,#00C3C6", :description => level
            end
        end
      end
    end

  end
我不确定错误是从哪里来的,但我希望得到任何帮助

最好的, 埃利奥特

我知道了

          xml.value value,  :xid => index, :color => "#00C3C6", :gradient_fill_colors => "#009c9d,#00C3C6", :description => level
在该行中,未定义第二个“值”和“级别”变量。一旦他们成功了,一切都会成功