tracks/app/views/stats/actions_done_last30days_data.html.erb
2014-06-10 17:50:47 -04:00

26 lines
No EOL
1.2 KiB
Text

<%-
created_count_array = Array.new(30){ |i| @actions_created_last30days.size/30.0 }
done_count_array = Array.new(30){ |i| @actions_done_last30days.size/30.0 }
# TODO: make the strftime i18n proof
time_labels = Array.new(30){ |i| l(Time.zone.now-i.days, :format => :stats) }
-%>
&title=<%= t('stats.actions_30days_title') %>,{font-size:16},&
&y_legend=<%= t('stats.legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.legend.number_of_days') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created') %>,9&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,9&
&line_3=3,0x00FF00, <%= t('stats.labels.avg_created') %>, 9&
&line_4=3,0xFF0000, <%= t('stats.labels.avg_completed') %>, 9&
&values=<%= @actions_created_last30days_array.join(",")%>&
&values_2=<%= @actions_done_last30days_array.join(",")%>&
&values_3=<%= created_count_array.join(",")%>&
&values_4=<%= done_count_array.join(",")%>&
&x_labels=<%= time_labels.join(",")%>&
&y_min=0&
<% # max + 10% for some extra space at the top
# add one to @max for people who have no actions completed yet.
# OpenFlashChart cannot handle y_max=0
-%>
&y_max=<%=@max+@max/10+1 -%>&
&x_label_style=9,,2,3&