@@ -2,8 +2,8 @@ function initPage(statByCategories, statByCountries) {
2
2
var chartsVersion = '44' ;
3
3
google . charts . load ( chartsVersion , { 'packages' :[ 'corechart' ] } ) ;
4
4
google . charts . setOnLoadCallback ( function drawCharts ( ) {
5
- drawChart ( 'categories-chart' , createCategoriesDataTable ( statByCategories ) ) ;
6
- drawChart ( 'countries-chart' , createCountriesDataTable ( statByCountries ) ) ;
5
+ drawChart ( 'categories-chart' , createDataTable ( statByCategories ) ) ;
6
+ drawChart ( 'countries-chart' , createDataTable ( statByCountries ) ) ;
7
7
} ) ;
8
8
}
9
9
@@ -15,17 +15,9 @@ function drawChart(containerId, dataTable) {
15
15
chart . draw ( dataTable , options ) ;
16
16
} ;
17
17
18
- function createCategoriesDataTable ( stat ) {
18
+ function createDataTable ( stat ) {
19
19
var table = new google . visualization . DataTable ( ) ;
20
- table . addColumn ( 'string' , 'Category' ) ;
21
- table . addColumn ( 'number' , 'Quantity of stamps' ) ;
22
- table . addRows ( stat ) ;
23
- return table ;
24
- } ;
25
-
26
- function createCountriesDataTable ( stat ) {
27
- var table = new google . visualization . DataTable ( ) ;
28
- table . addColumn ( 'string' , 'Country' ) ;
20
+ table . addColumn ( 'string' , 'Category/Country' ) ;
29
21
table . addColumn ( 'number' , 'Quantity of stamps' ) ;
30
22
table . addRows ( stat ) ;
31
23
return table ;
0 commit comments