+
- COUNT of {{_fieldName(item)}}
- SUM of {{_fieldName(item)}}
- MIN of {{_fieldName(item)}}
- MAX of {{_fieldName(item)}}
- AVG of {{_fieldName(item)}}
- FIRST of {{_fieldName(item)}}
- LAST of {{_fieldName(item)}}
+
+ {{_operationName(0)}} {{_fieldName(item)}}
+ {{_operationName(1)}} {{_fieldName(item)}}
+ {{_operationName(2)}} {{_fieldName(item)}}
+ {{_operationName(3)}} {{_fieldName(item)}}
+ {{_operationName(4)}} {{_fieldName(item)}}
+ {{_operationName(5)}} {{_fieldName(item)}}
+ {{_operationName(6)}} {{_fieldName(item)}}
@@ -409,6 +410,11 @@
value : false
},
+ functions : {
+ type : Array,
+ value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
+ },
+
modify : {
type : Boolean,
value : false
@@ -542,6 +548,7 @@
this.$.base_description.label = ln["description_" + ln["localization"]];
this.$.groupBy.innerHTML = ln["groupBy_" + ln["localization"]];
+ this.$.group_by.setAttribute("label", ln["groupBy_" + ln["localization"]]);
if(this.modify)
this.$.add_button.innerHTML = ln["modifyDatalet_" + ln["localization"]];
@@ -799,12 +806,14 @@
this.aggregators.push({"field": label, "operation": "GROUP BY"});
}
if(id.indexOf("calculate") > -1) {
- var label = $(ddls[i]).find("paper-menu")[0].selectedItem.textContent.trim();
-// var field = label.substring(label.lastIndexOf(" ")+1, label.length);
- var index = label.split(" ", 2).join(" ").length;
- var field = label.substring(index+1, label.length);
- var operation = label.substring(0, label.indexOf(" "));
- this.aggregators.push({"field": field, "operation": operation});
+ var menu = $(ddls[i]).find("paper-menu")[0];
+ var label = menu.selectedItem.textContent.trim();
+ var index = menu.selectedItem.id;
+ var ii = label.split(" ", 2).join(" ").length;
+ //attenzione BUG --> non funziona se la traduzione non ha solo 1 spazio
+ var field = label.substring(ii+1, label.length);
+// var operation = label.substring(0, label.indexOf(" "));
+ this.aggregators.push({"field": field, "operation": this.functions[index]});
}
}
},
@@ -917,6 +926,15 @@
return ln[key + "_" +ln["localization"]];
},
+ _calculateLabel: function() {
+ return ln["calculate" + "_" +ln["localization"]];
+ },
+
+ _operationName: function(index) {
+ var key = this.functions[index];
+ return ln[key + "_" +ln["localization"]];
+ },
+
_resize : function(){
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
h = h - 64 - 8; //height with page scroller
diff --git a/locales/controllet_ln.js b/locales/controllet_ln.js
index 9225d48..aaeba6c 100755
--- a/locales/controllet_ln.js
+++ b/locales/controllet_ln.js
@@ -28,18 +28,25 @@ ln["dataletPreview_it"] = "ANTEPRIMA";
ln["addDatalet_it"] = "AGGIUNGI";
ln["modifyDatalet_it"] = "MODIFICA";
-ln["addFilters_en"] = "ADD FILTERS";
-ln["filterField_en"] = "Field";
-ln["filterOperation_en"] = "Operation";
-ln["filterValue_en"] = "Value";
-ln["contains_en"] = "contains";
-ln["start_en"] = "start with";
-ln["ends_en"] = "ends with";
-ln["sortAscending_en"] = "sorted ascending";
-ln["sortDescending_en"] = "sorted descending";
-ln["unsort_en"] = "unsorted";
-//ln["countOf_en"] = "COUNT of";
-ln["groupBy_en"] = "GROUP BY";
+ln["addFilters_it"] = "AGGIUNGI FILTRI";
+ln["filterField_it"] = "Campo";
+ln["filterOperation_it"] = "Operazione";
+ln["filterValue_it"] = "Valore";
+ln["contains_it"] = "contiene";
+ln["start_it"] = "inizia con";
+ln["ends_it"] = "finisce con";
+ln["sortAscending_it"] = "ordinamento crescente";
+ln["sortDescending_it"] = "ordinamento decrescente";
+ln["unsort_it"] = "non ordinato";
+ln["groupBy_it"] = "RAGGRUPPA";
+ln["calculate_it"] = "CALCOLA";
+ln["COUNT_it"] = "CONTEGGIO di";
+ln["SUM_it"] = "SOMMA di";
+ln["MIN_it"] = "MINIMO di";
+ln["MAX_it"] = "MASSIMO di";
+ln["AVG_it"] = "MEDIA di";
+ln["FIRST_it"] = "PRIMO di";
+ln["LAST_it"] = "ULTIMO di";
ln["datatable_it"] = "tabella";
ln["barchart_it"] = "bar-chart";
@@ -131,6 +138,26 @@ ln["dataletPreview_en"] = "PREVIEW";
ln["addDatalet_en"] = "ADD";
ln["modifyDatalet_en"] = "MODIFY";
+ln["addFilters_en"] = "ADD FILTERS";
+ln["filterField_en"] = "Field";
+ln["filterOperation_en"] = "Operation";
+ln["filterValue_en"] = "Value";
+ln["contains_en"] = "contains";
+ln["start_en"] = "start with";
+ln["ends_en"] = "ends with";
+ln["sortAscending_en"] = "sorted ascending";
+ln["sortDescending_en"] = "sorted descending";
+ln["unsort_en"] = "unsorted";
+ln["groupBy_en"] = "GROUP BY";
+ln["calculate_en"] = "CALCULATE";
+ln["COUNT_en"] = "COUNT of";
+ln["SUM_en"] = "SUM of";
+ln["MIN_en"] = "MIN of";
+ln["MAX_en"] = "MAX of";
+ln["AVG_en"] = "AVG of";
+ln["FIRST_en"] = "FIRST of";
+ln["LAST_en"] = "LAST of";
+
ln["datatable_en"] = "table";
ln["barchart_en"] = "bar-chart";
//ln["bar-chart_en"] = "DDR bar-chart";
@@ -224,6 +251,26 @@ ln["dataletPreview_fr"] = "PREVISUALISATION";
ln["addDatalet_fr"] = "AJOUTER";
ln["modifyDatalet_fr"] = "MODIFIER";
+ln["addFilters_fr"] = "ADD FILTERS";
+ln["filterField_fr"] = "Field";
+ln["filterOperation_fr"] = "Operation";
+ln["filterValue_fr"] = "Value";
+ln["contains_fr"] = "contains";
+ln["start_fr"] = "start with";
+ln["ends_fr"] = "ends with";
+ln["sortAscending_fr"] = "sorted ascending";
+ln["sortDescending_fr"] = "sorted descending";
+ln["unsort_fr"] = "unsorted";
+ln["groupBy_fr"] = "GROUP BY";
+ln["calculate_fr"] = "CALCULATE";
+ln["COUNT_fr"] = "COUNT of";
+ln["SUM_fr"] = "SUM of";
+ln["MIN_fr"] = "MIN of";
+ln["MAX_fr"] = "MAX of";
+ln["AVG_fr"] = "AVG of";
+ln["FIRST_fr"] = "FIRST of";
+ln["LAST_fr"] = "LAST of";
+
ln["datatable_fr"] = "table fr";
ln["barchart_fr"] = "barchart";
ln["columnchart_fr"] = "columnchart";
@@ -314,6 +361,26 @@ ln["dataletPreview_nl"] = "VOORBEELD";
ln["addDatalet_nl"] = "TOEVOEGEN";
ln["modifyDatalet_nl"] = "WIJZIGEN";
+ln["addFilters_nl"] = "ADD FILTERS";
+ln["filterField_nl"] = "Field";
+ln["filterOperation_nl"] = "Operation";
+ln["filterValue_nl"] = "Value";
+ln["contains_nl"] = "contains";
+ln["start_nl"] = "start with";
+ln["ends_nl"] = "ends with";
+ln["sortAscending_nl"] = "sorted ascending";
+ln["sortDescending_nl"] = "sorted descending";
+ln["unsort_nl"] = "unsorted";
+ln["groupBy_nl"] = "GROUP BY";
+ln["calculate_nl"] = "CALCULATE";
+ln["COUNT_nl"] = "COUNT of";
+ln["SUM_nl"] = "SUM of";
+ln["MIN_nl"] = "MIN of";
+ln["MAX_nl"] = "MAX of";
+ln["AVG_nl"] = "AVG of";
+ln["FIRST_nl"] = "FIRST of";
+ln["LAST_nl"] = "LAST of";
+
ln["datatable_nl"] = "tafel";
ln["barchart_nl"] = "barchart";
ln["columnchart_nl"] = "columnchart";