@@ -208,48 +208,23 @@ <h4 class="panel-title" th:text="#{t_stamps_by_categories}">Stamps by categories
208
208
/*/-->
209
209
<!-- Charts -->
210
210
< script src ="https://www.gstatic.com/charts/loader.js "> </ script >
211
+ < script src ="../../../../javascript/collection/info.js " th:src ="${COLLECTION_INFO_JS} "> </ script >
211
212
< script th:inline ="javascript ">
212
213
/*<![CDATA[*/
213
-
214
- var drawChart = function ( containerId , table ) {
215
- var options = {
216
- pieHole : 0.3
217
- } ;
218
- var chart = new google . visualization . PieChart ( document . getElementById ( containerId ) ) ;
219
- chart . draw ( table , options ) ;
220
- } ;
221
-
222
- var createCategoriesDataTable = function ( ) {
223
- var table = new google . visualization . DataTable ( ) ;
224
- table . addColumn ( 'string' , 'Category' ) ;
225
- table . addColumn ( 'number' , 'Quantity of stamps' ) ;
226
-
214
+ $ ( function ( ) {
227
215
/*[+
228
- table.addRows([[${statOfCollectionByCategories}]]);
216
+ initPage(
217
+ [[${statOfCollectionByCategories}]],
218
+ [[${statOfCollectionByCountries}]]
219
+ );
229
220
+]*/
230
221
231
222
/*[- */
232
- table . addRows ( [
223
+ initPage ( [
233
224
[ 'Animals' , 94 ] ,
234
225
[ 'Prehistoric animals' , 37 ] ,
235
226
[ 'Sport' , 1 ]
236
- ] ) ;
237
- /* -]*/
238
-
239
- return table ;
240
- } ;
241
-
242
- var createCountriesDataTable = function ( ) {
243
- var table = new google . visualization . DataTable ( ) ;
244
- table . addColumn ( 'string' , 'Country' ) ;
245
- table . addColumn ( 'number' , 'Quantity of stamps' ) ;
246
-
247
- /*[+
248
- table.addRows([[${statOfCollectionByCountries}]]);
249
- +]*/
250
-
251
- /*[- */
252
- table . addRows ( [
227
+ ] , [
253
228
[ 'Russia' , 5 ] ,
254
229
[ 'USA' , 2 ] ,
255
230
[ 'Australia' , 11 ] ,
@@ -261,14 +236,6 @@ <h4 class="panel-title" th:text="#{t_stamps_by_categories}">Stamps by categories
261
236
[ 'Korea' , 2 ]
262
237
] ) ;
263
238
/* -]*/
264
-
265
- return table ;
266
- } ;
267
-
268
- google . charts . load ( '44' , { 'packages' :[ 'corechart' ] } ) ;
269
- google . charts . setOnLoadCallback ( function ( ) {
270
- drawChart ( 'categories-chart' , createCategoriesDataTable ( ) ) ;
271
- drawChart ( 'countries-chart' , createCountriesDataTable ( ) ) ;
272
239
} ) ;
273
240
274
241
/*]]>*/
0 commit comments