diff --git a/main.rb b/main.rb
index ffc3953..91bb2e7 100644
--- a/main.rb
+++ b/main.rb
@@ -30,12 +30,16 @@ def self.make_table(db)
end
get '/graphs/:id' do
- throw :halt, [ 404, "No such graph" ] unless Points.data.filter(:graph => params[:id]).count > 0
- erb :graph, :locals => { :id => params[:id] }
+ graphs = [ params[:id] ] + (params[:and] || '').split(',')
+ graphs.each do |graph|
+ throw :halt, [ 404, "No such graph \"#{graph}\"" ] unless Points.data.filter(:graph => graph).count > 0
+ end
+ erb :graph, :locals => { :id => params[:id], :others => params[:and] }
end
get '/graphs/:id/amstock_settings.xml' do
- erb :amstock_settings, :locals => { :id => params[:id] }
+ graphs = [ params[:id] ] + (params[:and] || '').split(',')
+ erb :amstock_settings, :locals => { :graphs => graphs }
end
get '/graphs/:id/data.csv' do
diff --git a/views/amstock_settings.erb b/views/amstock_settings.erb
index 8bc80bd..8bfed28 100644
--- a/views/amstock_settings.erb
+++ b/views/amstock_settings.erb
@@ -10,23 +10,27 @@
-
- <%= id %>
- <%= id %>
- 004090
- /graphs/<%= id %>/data.csv
-
- true
- ,
- YYYY-MM-DD hh:mm:ss
- .
-
- date
- volume
- close
-
-
-
+ <% graphs.each do |id| %>
+
+ true
+
+ <%= id %>
+ <%= id %>
+ <%= sprintf("%02x02x02x", rand(200), rand(200), rand(200)) %>
+ /graphs/<%= id %>/data.csv
+
+ true
+ ,
+ YYYY-MM-DD hh:mm:ss
+ .
+
+ date
+ volume
+ close
+
+
+
+ <% end %>
@@ -53,6 +57,8 @@
close
+ close
+
round_outline
- false
+ <%= graphs.size > 1 ? 'true' : 'false' %>
diff --git a/views/graph.erb b/views/graph.erb
index 43d44a6..b0a297a 100644
--- a/views/graph.erb
+++ b/views/graph.erb
@@ -12,7 +12,7 @@