diff --git a/lib/google_visualr.rb b/lib/google_visualr.rb index 425e366..7678101 100644 --- a/lib/google_visualr.rb +++ b/lib/google_visualr.rb @@ -37,6 +37,9 @@ # Image Charts require "#{lib_path}/google_visualr/image/spark_line" +require "#{lib_path}/google_visualr/image/bar_chart" +require "#{lib_path}/google_visualr/image/line_chart" +require "#{lib_path}/google_visualr/image/pie_chart" # Rails Helper diff --git a/lib/google_visualr/image/bar_chart.rb b/lib/google_visualr/image/bar_chart.rb new file mode 100644 index 0000000..3f6ffe7 --- /dev/null +++ b/lib/google_visualr/image/bar_chart.rb @@ -0,0 +1,47 @@ +module GoogleVisualr + module Image + + # http://code.google.com/apis/chart/interactive/docs/gallery/imagebarchart.html + class BarChart < BaseChart + include GoogleVisualr::Packages::ImageChart + + # For Configuration Options, please refer to: + # http://code.google.com/apis/chart/interactive/docs/gallery/imagebarchart.html + + # Create URI for image bar chart. Override parameters by passing in a hash. + # (see http://code.google.com/apis/chart/image/docs/chart_params.html) + # + # Parameters: + # *params [Optional] Hash of url query parameters + def uri(params = {}) + query_params = {} + + # isStacked/isVertical, Chart Type + chart_type = "b" + chart_type += @options["isVertical"] ? "v" : "h" + chart_type += @options["isStacked"] == false ? "g" : "s" + query_params[:cht] = chart_type + + # showCategoryLabels (works as long as :chxt => "x,y") + labels = "" + val_column = @options["isVertical"] ? 1 : 0 + cat_column = @options["isVertical"] ? 0 : 1 + if @options["showCategoryLabels"] == false + labels = "#{cat_column}:||" + else + labels = "#{cat_column}:|" + data_table.get_column(0).join('|') + "|" + end + + # showValueLabels (works as long as :chxt => "x,y") + if @options["showValueLabels"] == false + labels += "#{val_column}:||" + end + + query_params[:chxl] = labels unless labels.blank? + + chart_image_url(query_params.merge(params)) + end + end + + end +end diff --git a/lib/google_visualr/image/line_chart.rb b/lib/google_visualr/image/line_chart.rb new file mode 100644 index 0000000..1d046b5 --- /dev/null +++ b/lib/google_visualr/image/line_chart.rb @@ -0,0 +1,47 @@ +module GoogleVisualr + module Image + + # http://code.google.com/apis/chart/interactive/docs/gallery/imagelinechart.html + class LineChart < BaseChart + include GoogleVisualr::Packages::ImageChart + + # For Configuration Options, please refer to: + # http://code.google.com/apis/chart/interactive/docs/gallery/imagelinechart.html + + # Create URI for image line chart. Override parameters by passing in a hash. + # (see http://code.google.com/apis/chart/image/docs/chart_params.html) + # + # Parameters: + # *params [Optional] Hash of url query parameters + def uri(params = {}) + query_params = {} + + # Chart type: line + query_params[:cht] = "lc" + + # showAxisLines + if @options["showAxisLines"] == false + query_params[:cht] = "lc:nda" + end + + # showCategoryLabels (works as long as :chxt => "x,y") + labels = "" + if @options["showCategoryLabels"] == false + labels = "0:||" + else + labels = "0:|" + data_table.get_column(0).join('|') + "|" + end + + # showValueLabels (works as long as :chxt => "x,y") + if @options["showValueLabels"] == false + labels += "1:||" + end + + query_params[:chxl] = labels unless labels.blank? + + chart_image_url(query_params.merge(params)) + end + end + + end +end \ No newline at end of file diff --git a/lib/google_visualr/image/pie_chart.rb b/lib/google_visualr/image/pie_chart.rb new file mode 100644 index 0000000..1e54b1a --- /dev/null +++ b/lib/google_visualr/image/pie_chart.rb @@ -0,0 +1,47 @@ +module GoogleVisualr + module Image + + # http://code.google.com/apis/chart/interactive/docs/gallery/imagepiechart.html + class PieChart < BaseChart + include GoogleVisualr::Packages::ImageChart + + # For Configuration Options, please refer to: + # http://code.google.com/apis/chart/interactive/docs/gallery/imagepiechart.html + + # Create URI for image pie chart. Override parameters by passing in a hash. + # (see http://code.google.com/apis/chart/image/docs/chart_params.html) + # + # Parameters: + # *params [Optional] Hash of url query parameters + def uri(params = {}) + query_params = {} + + # Chart Type: normal or 3D + query_params[:cht] = @options["is3D"] ? "p3" : "p" + + # Legend (override generic image chart behavior) + query_params[:chdl] = @data_table.get_column(0).join('|') + + # Labels + case options["labels"] + when "name" + query_params[:chl] = @data_table.get_column(0).join('|') + when "value" + query_params[:chl] = @data_table.get_column(1).join('|') + else + query_params[:chl] = "" + end + + # data (override generic chart behavior) + query_params[:chd] = "t:" + @data_table.get_column(1).join(',') + + # Chart Colors (override generic chart default) + query_params[:chco] = @options["colors"].join('|').gsub(/#/, '') if @options["colors"] + + chart_image_url(query_params.merge(params)) + end + + end + + end +end \ No newline at end of file diff --git a/lib/google_visualr/image/spark_line.rb b/lib/google_visualr/image/spark_line.rb index dadce03..8de857b 100644 --- a/lib/google_visualr/image/spark_line.rb +++ b/lib/google_visualr/image/spark_line.rb @@ -6,8 +6,29 @@ class SparkLine < BaseChart include GoogleVisualr::Packages::ImageChart # For Configuration Options, please refer to: - # http://code.google.com/apis/chart/interactive/docs/gallery/imagesparkline.html#Configuration_Options - end + # http://code.google.com/apis/chart/interactive/docs/gallery/imagesparkline.html + + # Create URI for sparkline. Override parameters by passing in a hash. + # (see http://code.google.com/apis/chart/image/docs/chart_params.html) + # + # Parameters: + # *params [Optional] Hash of url query parameters + def uri(params = {}) + query_params = {} + + # Chart type: line + query_params[:cht] = "ls" + + # showValueLabels (works as long as :chxt => "x,y") + labels = "0:||" + if @options["showValueLabels"] == false || !@options["showAxisLines"] + labels += "1:||" + end + + query_params[:chxl] = labels + chart_image_url(query_params.merge(params)) + end + end end end diff --git a/lib/google_visualr/packages.rb b/lib/google_visualr/packages.rb index 645e30a..99d3c92 100644 --- a/lib/google_visualr/packages.rb +++ b/lib/google_visualr/packages.rb @@ -17,12 +17,94 @@ def package_name end module ImageChart + include GoogleVisualr::ParamHelpers + def package_name "image#{self.class.to_s.split("::").last.downcase}" end def class_name "Image#{self.class.to_s.split('::').last}" end + + # Set defaults according to http://code.google.com/apis/chart/interactive/docs/gallery/genericimagechart.html#Configuration_Options + IMAGE_DEFAULTS = { + # Automatic Scaling + :chds => "a", + # Size + :chs => "400x200", + # Axes + :chxt => "x,y" + } + + # Generates HTTP GET URL for the chart image + # + # Parameters: + # *opts [Optional] Hash of standard chart options (see http://code.google.com/apis/chart/image/docs/chart_params.html) + def chart_image_url(superseding_params = {}) + + ##### + # Generic image chart defaults + query_params = IMAGE_DEFAULTS.clone + + # backgroundColor + query_params[:chf] = "bg,s," + options["backgroundColor"].gsub(/#/, '') if options["backgroundColor"] + + # color, colors ('color' param is ignored if 'colors' is present) + if options["colors"] + query_params[:chco] = options["colors"].join(',').gsub(/#/, '') + elsif options["color"] + query_params[:chco] = options["color"].gsub(/#/, '') + end + + # fill (this will often not look good - better for user to override this parameter) + query_params[:chm] = "B,#{query_params[:chco].split(',').first},0,0,0" if options["fill"] && query_params[:chco] + + # firstHiddenColumn, singleColumnDisplay, data + firstHiddenColumn = options["firstHiddenColumn"] ? options["firstHiddenColumn"] : data_table.cols.size - 1 + query_params[:chd] = "t:" + unless options["singleColumnDisplay"] + for i in 1..firstHiddenColumn do + query_params[:chd] += "|" if i > 1 + query_params[:chd] += data_table.get_column(i).join(',') + end + else + query_params[:chd] += data_dable.get_column(options["singleColumnDisplay"]) + end + + # height, width + if options["height"] && options["width"] + query_params[:chs] = "#{options["width"]}x#{options["height"]}" + end + + # title + query_params[:chtt] = options["title"] if options["title"] + + # legend + unless options["legend"] == 'none' + query_params[:chdlp] = options["legend"].first unless options["legend"].blank? + query_params[:chdl] = data_table.cols[1..-1].map{|col| col[:label] }.join('|') + else + query_params.delete(:chdlp) + query_params.delete(:chdl) + end + + # min, max, valueLabelsInterval (works as long as :chxt => "x,y" and both 'min' and 'max' are set) + if options["min"] && options["max"] + query_params[:chxr] = "1,#{options['min']},#{options['max']}" + query_params[:chxr] += ",#{options['valueLabelsInterval']}" if options['valueLabelsInterval'] + query_params[:chds] = "#{options['min']},#{options['max']}" + end + ##### + + query_params = stringify_keys!(query_params.merge(superseding_params)) + base_url = "https://chart.googleapis.com/chart" + query = "" + query_params.each_with_index do |(k,v),i| + query += (i == 0) ? "?" : "&" + query += "#{k}=#{CGI.escape(v)}" + end + URI.parse(base_url + query) + end end end diff --git a/spec/google_visualr/image_charts_spec.rb b/spec/google_visualr/image_charts_spec.rb new file mode 100644 index 0000000..7b20736 --- /dev/null +++ b/spec/google_visualr/image_charts_spec.rb @@ -0,0 +1,65 @@ +require 'spec_helper' + +describe GoogleVisualr::Image::PieChart do + describe "#uri" do + let(:chart){ GoogleVisualr::Image::PieChart.new( data_table, {} )} + image_pie_options.each_with_index do |opts, i| + context "#{opts.inspect}" do + it "generates correct URI" do + chart.options = opts + uri = chart.uri + #puts uri.to_s + CGI.parse(uri.query).should == CGI.parse(image_pie_chart_uris[i].query) + end + end + end + end +end + +describe GoogleVisualr::Image::LineChart do + describe "#uri" do + let(:chart){ GoogleVisualr::Image::LineChart.new( data_table, {} )} + image_line_options.each_with_index do |opts, i| + context "#{opts.inspect}" do + it "generates correct URI" do + chart.options = opts + uri = chart.uri + #puts uri.to_s + CGI.parse(uri.query).should == CGI.parse(image_line_chart_uris[i].query) + end + end + end + end +end + +describe GoogleVisualr::Image::BarChart do + describe "#uri" do + let(:chart){ GoogleVisualr::Image::BarChart.new( data_table, {} )} + image_bar_options.each_with_index do |opts, i| + context "#{opts.inspect}" do + it "generates correct URI" do + chart.options = opts + uri = chart.uri + #puts uri.to_s + CGI.parse(uri.query).should == CGI.parse(image_bar_chart_uris[i].query) + end + end + end + end +end + +describe GoogleVisualr::Image::SparkLine do + describe "#uri" do + let(:chart){ GoogleVisualr::Image::SparkLine.new( data_table, {} )} + sparkline_options.each_with_index do |opts, i| + context "#{opts.inspect}" do + it "generates correct URI" do + chart.options = opts + uri = chart.uri + #puts uri.to_s + CGI.parse(uri.query).should == CGI.parse(sparkline_uris[i].query) + end + end + end + end +end \ No newline at end of file diff --git a/spec/support/common.rb b/spec/support/common.rb index 6ec7682..7bb94a5 100644 --- a/spec/support/common.rb +++ b/spec/support/common.rb @@ -31,3 +31,116 @@ def base_chart_js(div_class="div_class") js << "\n" end + +# Helpers for image chart specs + +def pie_data_table + @cols = [ + { :type => "string", :label => "Favorite Dessert" }, + { :type => "number", :label => "Count" } + ] + @rows = [ + { :c => [ {:v => "Pie"}, {:v => 100} ] }, + { :c => [ {:v => "Cake"}, {:v => 120} ] }, + { :c => [ {:v => "Ice Cream"}, {:v => 150} ] }, + { :c => [ {:v => "Cookies"}, {:v => 80 } ] } + ] + GoogleVisualr::DataTable.new(:cols => @cols, :rows => @rows) +end + +def image_pie_options + [ + { :title => "Favorite Desserts", :is3D => false, :labels => "name", :backgroundColor => "#EFEFEF", :legend => "left" }, + { :title => "Favorite Desserts", :width => 650, :height => 300, :is3D => true, :labels => "value", :backgroundColor => "#FFFFFF", + :legend => "bottom" }, + { :title => "Favorite Desserts", :width => 650, :height => 300, :is3D => false, :labels => "none", :backgroundColor => "#FFFFFF", + :color => "#444D92", :legend => "top" }, + { :title => "Favorite Desserts", :width => 650, :height => 300, :is3D => true, :labels => "none", :backgroundColor => "#FFFFFF", + :colors => ['#444D92', '#4c56a2', '#5E67AB', '#7078B5', '#8289BE', '#949AC7', + '#A6AAD0', '#B7BBDA', '#C9CCE3', '#DBDDEC', '#EDEEF6'], :legend => "none" } + ] +end + +def image_pie_chart_uris + [ + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CEFEFEF&chdl=2004%7C2005%7C2006%7C2007&chs=400x200&cht=p&chdlp=l&chtt=Favorite+Desserts&chl=2004%7C2005%7C2006%7C2007&chd=t%3A1000%2C1200%2C1500%2C800&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=2004%7C2005%7C2006%7C2007&chs=650x300&cht=p3&chdlp=b&chtt=Favorite+Desserts&chl=1000%7C1200%7C1500%7C800&chd=t%3A1000%2C1200%2C1500%2C800&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=2004%7C2005%7C2006%7C2007&chs=650x300&cht=p&chdlp=t&chtt=Favorite+Desserts&chco=444D92&chl=&chd=t%3A1000%2C1200%2C1500%2C800&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=2004%7C2005%7C2006%7C2007&chs=650x300&cht=p3&chtt=Favorite+Desserts&chco=444D92%7C4c56a2%7C5E67AB%7C7078B5%7C8289BE%7C949AC7%7CA6AAD0%7CB7BBDA%7CC9CCE3%7CDBDDEC%7CEDEEF6&chl=&chd=t%3A1000%2C1200%2C1500%2C800&chds=a") + ] +end + +def image_line_options + [ + { :title => "Test1 Line Chart", :colors => ['#437E9D', '#E6A65A'], :legend => "left", + :backgroundColor => "#EFEFEF", :showCategoryLabels => true, :showValueLabels => false }, + { :title => "Test2 Line Chart", :width => 500, :height => 200, :color => '#437E9D', :legend => "right", + :backgroundColor => "#FFFFFF", :showCategoryLabels => false, :showValueLabels => true }, + { :title => "Test3 Line Chart", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "top", + :showCategoryLabels => false, :showValueLabels => false, :showAxisLines => false }, + { :title => "Test4 Line Chart", :width => 500, :height => 200, :color => '#437E9D', :legend => "bottom", + :showCategoryLabels => true, :showValueLabels => true, :showAxisLines => true }, + { :title => "Test5 Line Chart", :width => 500, :height => 200, :color => '#437E9D', :legend => "none", + :showCategoryLabels => true, :showValueLabels => true, :min => 200, :max => 2000, :valueLabelsInterval => 200 } + ] +end + +def image_line_chart_uris + [ + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CEFEFEF&chdl=Sales%7CExpenses&chs=400x200&chxl=0%3A%7C2004%7C2005%7C2006%7C2007%7C1%3A%7C%7C&cht=lc&chdlp=l&chtt=Test1+Line+Chart&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C%7C&cht=lc&chdlp=r&chtt=Test2+Line+Chart&chco=437E9D&chds=a&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C%7C1%3A%7C%7C&cht=lc%3Anda&chdlp=t&chtt=Test3+Line+Chart&chco=437E9D%2CE6A65A&chds=a&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C2004%7C2005%7C2006%7C2007%7C&cht=lc&chdlp=b&chtt=Test4+Line+Chart&chco=437E9D&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chs=500x200&chxl=0%3A%7C2004%7C2005%7C2006%7C2007%7C&cht=lc&chtt=Test5+Line+Chart&chco=437E9D&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chxr=1%2C200%2C2000%2C200&chds=200%2C2000") + ] +end + +def image_bar_options + [ + { :title => "Test1 Bar Chart", :colors => ['#437E9D', '#E6A65A'], :legend => "left", + :backgroundColor => "#EFEFEF", :showCategoryLabels => true, :showValueLabels => false }, + { :title => "Test2 Bar Chart", :width => 500, :height => 200, :color => '#437E9D', :legend => "right", + :backgroundColor => "#FFFFFF", :showCategoryLabels => false, :showValueLabels => true }, + { :title => "Test3 Bar Chart", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "top", + :showCategoryLabels => false, :showValueLabels => false }, + { :title => "Test4 Bar Chart", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "bottom", + :showCategoryLabels => true, :showValueLabels => true, :isStacked => false, :isVertical => true }, + { :title => "Test5 Bar Chart", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "none", + :isStacked => true, :isVertical => true, :min => 200, :max => 2000, :valueLabelsInterval => 200 } + ] +end + +def image_bar_chart_uris + [ + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CEFEFEF&chdl=Sales%7CExpenses&chs=400x200&chxl=1%3A%7C2004%7C2005%7C2006%7C2007%7C0%3A%7C%7C&cht=bhs&chdlp=l&chtt=Test1+Bar+Chart&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=Sales%7CExpenses&chs=500x200&chxl=1%3A%7C%7C&cht=bhs&chdlp=r&chtt=Test2+Bar+Chart&chco=437E9D&chds=a&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=1%3A%7C%7C0%3A%7C%7C&cht=bhs&chdlp=t&chtt=Test3+Bar+Chart&chco=437E9D%2CE6A65A&chds=a&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C2004%7C2005%7C2006%7C2007%7C&cht=bvg&chdlp=b&chtt=Test4+Bar+Chart&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chs=500x200&chxl=0%3A%7C2004%7C2005%7C2006%7C2007%7C&cht=bvs&chtt=Test5+Bar+Chart&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chxr=1%2C200%2C2000%2C200&chds=200%2C2000") + ] +end + +def sparkline_options + [ + { :title => "Test1 Sparkline", :colors => ['#437E9D', '#E6A65A'], :legend => "left", + :backgroundColor => "#EFEFEF", :showAxisLines => false }, + { :title => "Test2 Sparkline", :width => 500, :height => 200, :color => '#437E9D', :legend => "right", + :backgroundColor => "#FFFFFF", :showAxisLines => true }, + { :title => "Test3 Sparkline", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "top", + :showAxisLines => false }, + { :title => "Test4 Sparkline", :width => 500, :height => 200, :color => '#437E9D', :legend => "bottom", + :showAxisLines => false }, + { :title => "Test5 Sparkline", :width => 500, :height => 200, :colors => ['#437E9D', '#E6A65A'], :legend => "none", + :showAxisLines => false } + ] +end + +def sparkline_uris + [ + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CEFEFEF&chdl=Sales%7CExpenses&chs=400x200&chxl=0%3A%7C%7C1%3A%7C%7C&cht=ls&chdlp=l&chtt=Test1+Sparkline&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chf=bg%2Cs%2CFFFFFF&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C%7C&cht=ls&chdlp=r&chtt=Test2+Sparkline&chco=437E9D&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C%7C1%3A%7C%7C&cht=ls&chdlp=t&chtt=Test3+Sparkline&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chdl=Sales%7CExpenses&chs=500x200&chxl=0%3A%7C%7C1%3A%7C%7C&cht=ls&chdlp=b&chtt=Test4+Sparkline&chco=437E9D&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a"), + URI.parse("https://chart.googleapis.com/chart?chxt=x%2Cy&chs=500x200&chxl=0%3A%7C%7C1%3A%7C%7C&cht=ls&chtt=Test5+Sparkline&chco=437E9D%2CE6A65A&chd=t%3A1000%2C1200%2C1500%2C800%7C400%2C450%2C600%2C500&chds=a") + ] +end \ No newline at end of file