clicks.html.erb
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/highcharts.js"></script>
<!--[if IE]>
<script type="text/javascript" src="/javascripts/excanvas.compiled.js"></script>
<![endif]-->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Clicks: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
<script type="text/javascript">
$(document).ready(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'line'
},
title: {
text: 'Clickstream'
},
subtitle: {
text: 'Source: AllOurIdeas.org (dummy data)'
},
xAxis: {
categories: ['Home#index', 'Question#show', 'Vote#left', 'Vote#right', 'Skip', 'Results'],
title: {
text: 'Page Category'
}
},
yAxis: {
title: {
text: 'Avg. Clicks per Day'
}
},
tooltip: {
enabled: false,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y +'°C';
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
}
}
},
series: [{
name: 'Logged In',
data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5]
}, {
name: 'Unregistered or Not Logged In',
data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2]
}]
});
});
</script>
</head>
<body>
<!-- 3. Add the container -->
<div id="container" style="width: 800px; height: 400px"></div>
<p style="color: green"><%= flash[:notice] %></p>
<%= yield %>
</body>
</html>