-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.html
198 lines (175 loc) · 7.87 KB
/
report.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<head>
<link href="report.css" rel="stylesheet">
<link media="all" href="nvd3/src/nv.d3.css" type="text/css" rel="stylesheet" />
<script src="nvd3/lib/d3.v2.js" type="text/javascript">
</script>
<script src="nvd3/nv.d3.js" type="text/javascript"></script>
</head>
<body>
<h1>Income Report</h1>
<h2>Year 2014</h2>
<div id="chart0"><svg style="width:700px; height:400px;"></svg></div>
<script type="text/javascript">
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.margin({top: 10, right: 10, bottom: 70, left: 70});
chart.color(d3.scale.category10().range());
chart.xAxis
.rotateLabels(-45);
chart.yAxis
.axisLabel('NZD ')
.tickFormat(d3.format('.00f'));
chart.tooltipContent(function(key, y, e, graph) {
var x = String(graph.point.x);
var y = String(graph.point.y);
if(key == 'Series 1'){
var y = String(graph.point.y) + ' NZD ';
}
tooltip_str = 'y = ' + y + '<br>x = ' + x;
return tooltip_str;
});
d3.select('#chart0 svg')
.datum(data0)
.transition().duration(500)
.attr('width', 700)
.attr('height', 400)
.call(chart);
return chart;
});
data0=[{"values": [{"y": 4880.0, "x": "2014-01-31"}], "key": "Series 1", "yAxis": "1"}];
</script>
<pre>
Total income = NZD 4880.0
Start date = 2014-01-01
End date = 2014-01-31
Total hours = 63
Hours per week = 14.7
Income per month = NZD 4880.0
Income per week = NZD 1138.67
Income per hour = NZD 77.46
</pre>
<h2>Last 12 Months</h2>
<div id="chart1"><svg style="width:700px; height:400px;"></svg></div>
<script type="text/javascript">
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.margin({top: 10, right: 10, bottom: 70, left: 70});
chart.color(d3.scale.category10().range());
chart.xAxis
.rotateLabels(-45);
chart.yAxis
.axisLabel('NZD ')
.tickFormat(d3.format('.00f'));
chart.tooltipContent(function(key, y, e, graph) {
var x = String(graph.point.x);
var y = String(graph.point.y);
if(key == 'Series 1'){
var y = String(graph.point.y) + ' NZD ';
}
tooltip_str = 'y = ' + y + '<br>x = ' + x;
return tooltip_str;
});
d3.select('#chart1 svg')
.datum(data1)
.transition().duration(500)
.attr('width', 700)
.attr('height', 400)
.call(chart);
return chart;
});
data1=[{"values": [{"y": 4360.0, "x": "2013-02-28"}, {"y": 2362.0, "x": "2013-03-31"}, {"y": 3458.0, "x": "2013-04-30"}, {"y": 4834.0, "x": "2013-05-31"}, {"y": 5896.0, "x": "2013-06-30"}, {"y": 1068.0, "x": "2013-07-31"}, {"y": 4577.0, "x": "2013-08-31"}, {"y": 2763.0, "x": "2013-09-30"}, {"y": 2888.0, "x": "2013-10-31"}, {"y": 2992.0, "x": "2013-11-30"}, {"y": 6206.0, "x": "2013-12-31"}, {"y": 4880.0, "x": "2014-01-31"}], "key": "Series 1", "yAxis": "1"}];
</script>
<pre>
Total income = NZD 46284.0
Start date = 2013-02-01
End date = 2014-01-31
Total hours = 613
Hours per week = 11.8
Income per month = NZD 3865.48
Income per week = NZD 890.08
Income per hour = NZD 75.5
</pre>
<h2>Tax Year 2013</h2>
<div id="chart2"><svg style="width:700px; height:400px;"></svg></div>
<script type="text/javascript">
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.margin({top: 10, right: 10, bottom: 70, left: 70});
chart.color(d3.scale.category10().range());
chart.xAxis
.rotateLabels(-45);
chart.yAxis
.axisLabel('NZD ')
.tickFormat(d3.format('.00f'));
chart.tooltipContent(function(key, y, e, graph) {
var x = String(graph.point.x);
var y = String(graph.point.y);
if(key == 'Series 1'){
var y = String(graph.point.y) + ' NZD ';
}
tooltip_str = 'y = ' + y + '<br>x = ' + x;
return tooltip_str;
});
d3.select('#chart2 svg')
.datum(data2)
.transition().duration(500)
.attr('width', 700)
.attr('height', 400)
.call(chart);
return chart;
});
data2=[{"values": [{"y": 3458.0, "x": "2013-04-30"}, {"y": 4834.0, "x": "2013-05-31"}, {"y": 5896.0, "x": "2013-06-30"}, {"y": 1068.0, "x": "2013-07-31"}, {"y": 4577.0, "x": "2013-08-31"}, {"y": 2763.0, "x": "2013-09-30"}, {"y": 2888.0, "x": "2013-10-31"}, {"y": 2992.0, "x": "2013-11-30"}, {"y": 6206.0, "x": "2013-12-31"}, {"y": 4880.0, "x": "2014-01-31"}], "key": "Series 1", "yAxis": "1"}];
</script>
<pre>
Total income = NZD 39562.0
Start date = 2013-04-01
End date = 2014-01-31
Total hours = 519
Hours per week = 11.9
Income per month = NZD 3943.23
Income per week = NZD 907.98
Income per hour = NZD 76.23
</pre>
<h2>All Data</h2>
<div id="chart3"><svg style="width:700px; height:400px;"></svg></div>
<script type="text/javascript">
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.margin({top: 10, right: 10, bottom: 70, left: 70});
chart.color(d3.scale.category10().range());
chart.xAxis
.rotateLabels(-45);
chart.yAxis
.axisLabel('NZD ')
.tickFormat(d3.format('.00f'));
chart.tooltipContent(function(key, y, e, graph) {
var x = String(graph.point.x);
var y = String(graph.point.y);
if(key == 'Series 1'){
var y = String(graph.point.y) + ' NZD ';
}
tooltip_str = 'y = ' + y + '<br>x = ' + x;
return tooltip_str;
});
d3.select('#chart3 svg')
.datum(data3)
.transition().duration(500)
.attr('width', 700)
.attr('height', 400)
.call(chart);
return chart;
});
data3=[{"values": [{"y": 4078.0, "x": "2012-03-31"}, {"y": 4302.0, "x": "2012-04-30"}, {"y": 5363.0, "x": "2012-05-31"}, {"y": 2801.0, "x": "2012-06-30"}, {"y": 2832.0, "x": "2012-07-31"}, {"y": 1836.0, "x": "2012-08-31"}, {"y": 4246.0, "x": "2012-09-30"}, {"y": 3378.0, "x": "2012-10-31"}, {"y": 5238.0, "x": "2012-11-30"}, {"y": 5414.0, "x": "2012-12-31"}, {"y": 3408.0, "x": "2013-01-31"}, {"y": 4360.0, "x": "2013-02-28"}, {"y": 2362.0, "x": "2013-03-31"}, {"y": 3458.0, "x": "2013-04-30"}, {"y": 4834.0, "x": "2013-05-31"}, {"y": 5896.0, "x": "2013-06-30"}, {"y": 1068.0, "x": "2013-07-31"}, {"y": 4577.0, "x": "2013-08-31"}, {"y": 2763.0, "x": "2013-09-30"}, {"y": 2888.0, "x": "2013-10-31"}, {"y": 2992.0, "x": "2013-11-30"}, {"y": 6206.0, "x": "2013-12-31"}, {"y": 4880.0, "x": "2014-01-31"}], "key": "Series 1", "yAxis": "1"}];
</script>
<pre>
Total income = NZD 89180.0
Start date = 2012-03-01
End date = 2014-01-31
Total hours = 1215
Hours per week = 12.1
Income per month = NZD 3867.44
Income per week = NZD 890.53
Income per hour = NZD 73.4
</pre>
</body>
</html>