app/views/audit_rails/audits/analytics.html.erb in audit_rails-1.1.2 vs app/views/audit_rails/audits/analytics.html.erb in audit_rails-1.1.3

- old
+ new

@@ -1,14 +1,14 @@ <%= javascript_include_tag "Chart.min"%> -<div id='analyticsByUser'>Analytics by User</div> +<div id='analyticsByUser'>User clicks</div> <br/> -<canvas id="canvas" height="450" width="600"></canvas> +<canvas id="userViews" height="450" width="600"></canvas> <script> - var lineChartData = { + var barChartData = { labels : <%= "#{@analysis_by_user_name.keys}".html_safe %>, datasets : [ { fillColor : "rgba(220,220,220,0.5)", strokeColor : "rgba(220,220,220,1)", @@ -18,8 +18,33 @@ } ] } - var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData); + var myBar = new Chart(document.getElementById("userViews").getContext("2d")).Bar(barChartData); + + </script> + +<div id='analyticsByPage'>Page views</div> +<br/> +<canvas id="pageViews" height="450" width="600"></canvas> + + + <script> + + var lineChartData = { + labels : <%= "#{@analysis_by_page_views.keys}".html_safe %>, + datasets : [ + { + fillColor : "rgba(220,220,220,0.5)", + strokeColor : "rgba(220,220,220,1)", + pointColor : "rgba(220,220,220,1)", + pointStrokeColor : "#fff", + data : <%= @analysis_by_page_views.values %> + } + ] + + } + + var myLine = new Chart(document.getElementById("pageViews").getContext("2d")).Line(lineChartData); </script> \ No newline at end of file