<%= Seer::init_visualization -%> <%- title "Intersite Traffic Report" -%> <%- if @total_visits.blank? -%>

This report shows traffic between different sites, e.g. a link from a local site to a corporate home page or from one local site to another.

<%- end -%> <%- if @sites.size == 1 -%>

No traffic data has been gathered yet. Please try again later.

<%- else -%>
<%= legend_tag "Report Criteria" -%>

<%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>

<%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>

<%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
<%- end -%>
<%- if ! params[:site].blank? && (@total_visits.blank? || @destinations_series.blank?) -%>

No data matched your criteria.

<%- elsif params[:site] -%>
<%= legend_tag "Total Intersite Referrals By Week", :help => "This graph shows the total number of clicks that resulted in traffic to other sites in the network. Click on a data point for more details." -%>
<%= Seer::visualize( @total_visits, :as => :line_chart, :in_element => 'total_chart', :series => { :series_label => 'Referrals', :data_label => 'short_date', :data_method => 'clickthroughs', :data_series => @total_visits_series }, :chart_options => { :height => 300, :width => 900, :axis_font_size => 11, :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'], :title => "", :point_size => 5, :legend => 'none' } ) -%>
<%= legend_tag "Intersite Referral Destinations", :help => "This graph shows the destinations of links that visitors clicked through to other sites in the network. Click on a bar in the graph below for a count of visits sent to the corresponding site." -%>
<%= Seer::visualize( @destinations_series, :as => :bar_chart, :in_element => 'destinations_chart', :series => {:series_label => 'site', :data_method => 'clickthroughs'}, :chart_options => { :height => @destinations_series.size * 20, :width => 900, :is_3_d => false, :legend => 'none', :colors => ["#7e7587"], :title => "# Referrals by Destination", :title_font_size => 9, :title_x => '', :axis_font_size => 10 } ) -%>
<%= render 'print_buttons' -%> <%- end -%>