質問するログイン新規登録

質問編集履歴

1

コードを

2016/09/26 21:42

投稿

flawade3
flawade3

スコア8

title CHANGED
File without changes
body CHANGED
@@ -17,6 +17,7 @@
17
17
  </head>
18
18
  <body>
19
19
  <script type="text/javascript" >
20
+ ```
20
21
  var data = [
21
22
  {"number":"4","shot":3,"result":"yes","time":"4時20分20秒"},
22
23
  {"number":"5","shot":1,"result":"no","time":"4時20分23秒"},
@@ -69,7 +70,7 @@
69
70
  aggregators: {
70
71
  "シュート数": function() { return tpl.count()() },
71
72
  "合計": function() { return tpl.sum()(["shot"]) },
72
- "成功率": function() { return tpl.countAsFractionOfRow()() }
73
+ "成功率": function() { return tpl.countAsFractionOfRow()() }
73
74
  },
74
75
  rendererName: "Table"
75
76
  },
@@ -77,12 +78,19 @@
77
78
  );
78
79
  });
79
80
 
81
+ ``````jQuery```
82
+
80
83
  </script>
84
+
85
+
86
+ ```
81
87
  <div id="output"></div>
88
+ ``````HTML
89
+ ```
82
90
  </body>
83
91
  </html>
84
92
 
85
93
 
86
94
  ###試したこと
87
95
  count,sumは上記のソースだけで実装できました。しかし、countAsFractionOfRow()では実装できませんでした。どう書けば実装できるのかどなたか教えてください。
88
- 参考にしたページは「http://tweeeety.hateblo.jp/entry/20140203/1391408894」と「https://github.com/nicolaskruchten/pivottable/wiki/Aggregators」です。
96
+ 参考にしたページは「[PivotTable.jsを使ってjavascriptで集計を簡単に表示するテスト](http://tweeeety.hateblo.jp/entry/20140203/1391408894)」と「[Aggregators](https://github.com/nicolaskruchten/pivottable/wiki/Aggregators)」です。