@esfaenza/es-charts 11.2.21 → 11.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/bundles/esfaenza-es-charts.umd.js +362 -390
  2. package/bundles/esfaenza-es-charts.umd.js.map +1 -1
  3. package/bundles/esfaenza-es-charts.umd.min.js +1 -1
  4. package/bundles/esfaenza-es-charts.umd.min.js.map +1 -1
  5. package/esfaenza-es-charts.d.ts +4 -5
  6. package/esfaenza-es-charts.metadata.json +1 -1
  7. package/esm2015/esfaenza-es-charts.js +5 -6
  8. package/esm2015/lib/adapters/BaseAdapter.js +47 -0
  9. package/esm2015/lib/adapters/IBaseAdapter.js +2 -0
  10. package/esm2015/lib/components/base/base-chart.component.js +3 -2
  11. package/esm2015/lib/components/chart-pager/chart-pager.component.js +1 -1
  12. package/esm2015/lib/components/specializations/es-area-chart.component.js +6 -5
  13. package/esm2015/lib/components/specializations/es-chart.component.js +18 -5
  14. package/esm2015/lib/components/specializations/es-line-chart.component.js +6 -5
  15. package/esm2015/lib/components/specializations/es-pie-chart.component.js +6 -5
  16. package/esm2015/lib/components/specializations/es-vertical-2d-chart.component.js +6 -5
  17. package/esm2015/lib/components/specializations/es-vertical-chart.component.js +6 -5
  18. package/esm2015/lib/components/specializations/es-vertical-stacked-chart.component.js +6 -5
  19. package/esm2015/lib/es-charts.module.js +13 -5
  20. package/esm2015/lib/models/core/ChartDispatcher.js +88 -0
  21. package/esm2015/lib/models/core/ChartLoader.js +201 -0
  22. package/esm2015/lib/models/core/ChartThemes.js +61 -0
  23. package/esm2015/lib/models/data/AreaChartData.js +16 -0
  24. package/esm2015/lib/models/data/LineChartData.js +16 -0
  25. package/esm2015/lib/models/data/PagedChartData.js +20 -0
  26. package/esm2015/lib/models/data/PieChartData.js +14 -0
  27. package/esm2015/lib/models/data/Vertical2DChartData.js +16 -0
  28. package/esm2015/lib/models/data/VerticalChartData.js +14 -0
  29. package/esm2015/lib/models/data/VerticalStackedChartData.js +14 -0
  30. package/esm2015/lib/models/data/base/DateValue.js +11 -0
  31. package/esm2015/lib/models/data/base/KeyValue.js +11 -0
  32. package/esm2015/lib/models/data/base/KeyValueColor.js +12 -0
  33. package/esm2015/lib/models/data/base/Limit.js +15 -0
  34. package/esm2015/lib/models/data/base/LineSerie.js +24 -0
  35. package/esm2015/lib/models/settings/AreaChartSettings.js +11 -0
  36. package/esm2015/lib/models/settings/LineChartSettings.js +11 -0
  37. package/esm2015/lib/models/settings/PieChartSettings.js +7 -0
  38. package/esm2015/lib/models/settings/Vertical2DChartSettings.js +11 -0
  39. package/esm2015/lib/models/settings/VerticalChartSettings.js +11 -0
  40. package/esm2015/lib/models/settings/VerticalStackedChartSettings.js +11 -0
  41. package/esm2015/lib/models/settings/base/BaseInterval.js +6 -0
  42. package/esm2015/lib/models/settings/base/BaseSettings.js +6 -0
  43. package/esm2015/lib/models/settings/base/LegendPad.js +6 -0
  44. package/esm2015/lib/services/AreaChartService.js +135 -0
  45. package/esm2015/lib/services/LineChartService.js +339 -0
  46. package/esm2015/lib/services/PieChartService.js +112 -0
  47. package/esm2015/lib/services/Vertical2DChartService.js +163 -0
  48. package/esm2015/lib/services/VerticalChartService.js +105 -0
  49. package/esm2015/lib/services/VerticalStackedChartService.js +127 -0
  50. package/esm2015/lib/services/base/IBaseService.js +2 -0
  51. package/esm2015/public-api.js +25 -25
  52. package/fesm2015/esfaenza-es-charts.js +351 -370
  53. package/fesm2015/esfaenza-es-charts.js.map +1 -1
  54. package/lib/adapters/{classes/BaseAdapter.d.ts → BaseAdapter.d.ts} +6 -1
  55. package/lib/adapters/{classes/IBaseAdapter.d.ts → IBaseAdapter.d.ts} +6 -1
  56. package/lib/components/base/base-chart.component.d.ts +10 -4
  57. package/lib/components/chart-pager/chart-pager.component.d.ts +1 -1
  58. package/lib/components/specializations/es-area-chart.component.d.ts +6 -4
  59. package/lib/components/specializations/es-chart.component.d.ts +17 -5
  60. package/lib/components/specializations/es-line-chart.component.d.ts +6 -4
  61. package/lib/components/specializations/es-pie-chart.component.d.ts +6 -4
  62. package/lib/components/specializations/es-vertical-2d-chart.component.d.ts +6 -4
  63. package/lib/components/specializations/es-vertical-chart.component.d.ts +6 -4
  64. package/lib/components/specializations/es-vertical-stacked-chart.component.d.ts +6 -4
  65. package/lib/models/core/{classes/ChartDispatcher.d.ts → ChartDispatcher.d.ts} +0 -0
  66. package/lib/models/core/{classes/ChartLoader.d.ts → ChartLoader.d.ts} +0 -0
  67. package/lib/models/core/{classes/ChartThemes.d.ts → ChartThemes.d.ts} +0 -0
  68. package/lib/models/data/{classes/AreaChartData.d.ts → AreaChartData.d.ts} +1 -1
  69. package/lib/models/data/{classes/LineChartData.d.ts → LineChartData.d.ts} +0 -0
  70. package/lib/models/data/{classes/PagedChartData.d.ts → PagedChartData.d.ts} +0 -0
  71. package/lib/models/data/{classes/PieChartData.d.ts → PieChartData.d.ts} +0 -0
  72. package/lib/models/data/{classes/Vertical2DChartData.d.ts → Vertical2DChartData.d.ts} +0 -0
  73. package/lib/models/data/{classes/VerticalChartData.d.ts → VerticalChartData.d.ts} +0 -0
  74. package/lib/models/data/{classes/VerticalStackedChartData.d.ts → VerticalStackedChartData.d.ts} +0 -0
  75. package/lib/models/data/{classes/base → base}/DateValue.d.ts +0 -0
  76. package/lib/models/data/{classes/base → base}/KeyValue.d.ts +0 -0
  77. package/lib/models/data/{classes/base → base}/KeyValueColor.d.ts +0 -0
  78. package/lib/models/data/{classes/base → base}/Limit.d.ts +0 -0
  79. package/lib/models/data/{classes/base → base}/LineSerie.d.ts +1 -1
  80. package/lib/models/settings/{classes/AreaChartSettings.d.ts → AreaChartSettings.d.ts} +0 -0
  81. package/lib/models/settings/{classes/LineChartSettings.d.ts → LineChartSettings.d.ts} +0 -0
  82. package/lib/models/settings/{classes/PieChartSettings.d.ts → PieChartSettings.d.ts} +0 -0
  83. package/lib/models/settings/{classes/Vertical2DChartSettings.d.ts → Vertical2DChartSettings.d.ts} +0 -0
  84. package/lib/models/settings/{classes/VerticalChartSettings.d.ts → VerticalChartSettings.d.ts} +0 -0
  85. package/lib/models/settings/{classes/VerticalStackedChartSettings.d.ts → VerticalStackedChartSettings.d.ts} +0 -0
  86. package/lib/models/settings/{classes/base → base}/BaseInterval.d.ts +0 -0
  87. package/lib/models/settings/{classes/base → base}/BaseSettings.d.ts +1 -1
  88. package/lib/models/settings/{classes/base → base}/LegendPad.d.ts +0 -0
  89. package/lib/services/{classes/AreaChartService.d.ts → AreaChartService.d.ts} +3 -3
  90. package/lib/services/{classes/LineChartService.d.ts → LineChartService.d.ts} +3 -3
  91. package/lib/services/{classes/PieChartService.d.ts → PieChartService.d.ts} +3 -3
  92. package/lib/services/{classes/Vertical2DChartService.d.ts → Vertical2DChartService.d.ts} +3 -3
  93. package/lib/services/{classes/VerticalChartService.d.ts → VerticalChartService.d.ts} +3 -3
  94. package/lib/services/{classes/VerticalStackedChartService.d.ts → VerticalStackedChartService.d.ts} +3 -3
  95. package/lib/services/{classes/base → base}/IBaseService.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/public-api.d.ts +24 -24
  98. package/esm2015/lib/adapters/classes/BaseAdapter.js +0 -47
  99. package/esm2015/lib/adapters/classes/IBaseAdapter.js +0 -2
  100. package/esm2015/lib/adapters/index.js +0 -3
  101. package/esm2015/lib/components/index.js +0 -9
  102. package/esm2015/lib/models/core/classes/ChartDispatcher.js +0 -88
  103. package/esm2015/lib/models/core/classes/ChartLoader.js +0 -201
  104. package/esm2015/lib/models/core/classes/ChartThemes.js +0 -61
  105. package/esm2015/lib/models/core/index.js +0 -4
  106. package/esm2015/lib/models/data/classes/AreaChartData.js +0 -16
  107. package/esm2015/lib/models/data/classes/LineChartData.js +0 -16
  108. package/esm2015/lib/models/data/classes/PagedChartData.js +0 -20
  109. package/esm2015/lib/models/data/classes/PieChartData.js +0 -14
  110. package/esm2015/lib/models/data/classes/Vertical2DChartData.js +0 -16
  111. package/esm2015/lib/models/data/classes/VerticalChartData.js +0 -14
  112. package/esm2015/lib/models/data/classes/VerticalStackedChartData.js +0 -14
  113. package/esm2015/lib/models/data/classes/base/DateValue.js +0 -11
  114. package/esm2015/lib/models/data/classes/base/KeyValue.js +0 -11
  115. package/esm2015/lib/models/data/classes/base/KeyValueColor.js +0 -12
  116. package/esm2015/lib/models/data/classes/base/Limit.js +0 -15
  117. package/esm2015/lib/models/data/classes/base/LineSerie.js +0 -24
  118. package/esm2015/lib/models/data/index.js +0 -13
  119. package/esm2015/lib/models/settings/classes/AreaChartSettings.js +0 -11
  120. package/esm2015/lib/models/settings/classes/LineChartSettings.js +0 -11
  121. package/esm2015/lib/models/settings/classes/PieChartSettings.js +0 -7
  122. package/esm2015/lib/models/settings/classes/Vertical2DChartSettings.js +0 -11
  123. package/esm2015/lib/models/settings/classes/VerticalChartSettings.js +0 -11
  124. package/esm2015/lib/models/settings/classes/VerticalStackedChartSettings.js +0 -11
  125. package/esm2015/lib/models/settings/classes/base/BaseInterval.js +0 -6
  126. package/esm2015/lib/models/settings/classes/base/BaseSettings.js +0 -6
  127. package/esm2015/lib/models/settings/classes/base/LegendPad.js +0 -6
  128. package/esm2015/lib/models/settings/index.js +0 -10
  129. package/esm2015/lib/services/classes/AreaChartService.js +0 -135
  130. package/esm2015/lib/services/classes/LineChartService.js +0 -358
  131. package/esm2015/lib/services/classes/PieChartService.js +0 -112
  132. package/esm2015/lib/services/classes/Vertical2DChartService.js +0 -163
  133. package/esm2015/lib/services/classes/VerticalChartService.js +0 -105
  134. package/esm2015/lib/services/classes/VerticalStackedChartService.js +0 -127
  135. package/esm2015/lib/services/classes/base/IBaseService.js +0 -2
  136. package/esm2015/lib/services/index.js +0 -8
  137. package/lib/adapters/index.d.ts +0 -2
  138. package/lib/components/index.d.ts +0 -8
  139. package/lib/models/core/index.d.ts +0 -3
  140. package/lib/models/data/index.d.ts +0 -12
  141. package/lib/models/settings/index.d.ts +0 -9
  142. package/lib/services/index.d.ts +0 -7
@@ -673,111 +673,6 @@
673
673
  return LineSerie;
674
674
  }());
675
675
 
676
- /**
677
- * Token che identifica il Locale di default per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
678
- */
679
- var ESC_LOCALE = new core.InjectionToken('ESC_LOCALE');
680
- /**
681
- * Token che identifica il default per l'utilizzo o meno delle Animazioni per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
682
- */
683
- var ESC_ANIMATIONS = new core.InjectionToken('ESC_ANIMATIONS');
684
- /**
685
- * Token che identifica il Tema di default per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
686
- */
687
- var ESC_THEME = new core.InjectionToken('ESC_THEME');
688
- /**
689
- * Token che identifica l'utilizzo o meno del sistema di Log per l'intera libreria
690
- */
691
- var ESC_LOGS = new core.InjectionToken('ESC_LOGS');
692
-
693
- /**
694
- * Classe che si occupa del dispatch delle operazioni di rendering dei grafici utilizzando una coda per permettere ad ogni grafico di avere temi e localizzazione custom
695
- */
696
- var ChartDispatcher = /** @class */ (function () {
697
- /**
698
- * @ignore
699
- */
700
- function ChartDispatcher(logs) {
701
- this.logs = logs;
702
- /**
703
- * Coda di inizializzazioni ancora da eseguire. Quando questa è vuota significa che nessuno sta creando grafici
704
- */
705
- this.Initializations = [];
706
- /**
707
- * Lista dei grafici inizializzati e attivi in un dato momento (viene registrata la proprietà **name**). Non è possibile registrare due grafici con lo stesso identificativo
708
- */
709
- this.InitializedGraphs = [];
710
- }
711
- /**
712
- * Registra un grafico da visualizzare insieme alla propria funzione di creazione. Quest'ultima sarà differita fino a che tutti i grafici
713
- * precedentemente registati non hanno finito la fase di inizializzazione
714
- *
715
- * @param {string} name Identificativo del grafico da registrare
716
- * @param {Function} chartCreationFunction Funzione che fisicamente dovrà occuparsi della creazione del grafico
717
- */
718
- ChartDispatcher.prototype.register = function (name, chartCreationFunction) {
719
- if (this.InitializedGraphs.indexOf(name) != -1)
720
- throw "Attempting to register a duplicate chart '" + name + "'. Make sure the 'name' properties of your charts are univoque";
721
- this.log("DISPATCHER: Registering chart creation function execution for " + name);
722
- this.Initializations.push({ name: name, function: chartCreationFunction });
723
- if (this.Initializations.length == 1) {
724
- this.log("DISPATCHER: Initial drain started");
725
- this.drainInitQueues();
726
- }
727
- };
728
- /**
729
- * Deregistra un grafico presente. Chiamata generalmente al dispose del grafico in questione quando non dev'essere più mostrato nella pagina corrente
730
- *
731
- * @param {string} name Identificativo del grafico da deregistrare
732
- */
733
- ChartDispatcher.prototype.deregisterGraph = function (name) {
734
- var index = this.InitializedGraphs.indexOf(name);
735
- if (index == -1) {
736
- //Questo succede quando si cerca di distruggere il grafico mentre sta venendo graficato
737
- this.log("DISPATCHER: Registration missing for chart " + name + " it was probably destroyed during load");
738
- return;
739
- }
740
- this.log("DISPATCHER: Chart deregistered " + name);
741
- this.InitializedGraphs.splice(index, 1);
742
- };
743
- /**
744
- * Metodo che esegue in maniera sequenziale le funzioni di inizializzazione dei grafici finché presenti
745
- * in modo che nessun grafico possa essere inizializzato contemporaneamente ad un altro.
746
- *
747
- * Questo è il punto chiave che permette di avere per ogni grafico temi e locale differenti
748
- */
749
- ChartDispatcher.prototype.drainInitQueues = function () {
750
- var _this = this;
751
- var toExecute = this.Initializations[0];
752
- this.log("DISPATCHER: Executing initialization function for chart " + toExecute.name);
753
- toExecute.function().then(function () {
754
- _this.log("DISPATCHER: initialization for chart " + toExecute.name + " is done");
755
- _this.InitializedGraphs.push(toExecute.name);
756
- _this.Initializations.splice(0, 1);
757
- if (_this.Initializations.length >= 1) {
758
- _this.log("DISPATCHER: Found queued initializations. Continuing");
759
- _this.drainInitQueues();
760
- }
761
- else
762
- _this.log("DISPATCHER: queue is over, nothing more to do");
763
- });
764
- };
765
- /**
766
- * @ignore
767
- */
768
- ChartDispatcher.prototype.log = function (text) {
769
- if (this.logs)
770
- console.log("@esfaenza/es-charts: " + text);
771
- };
772
- return ChartDispatcher;
773
- }());
774
- ChartDispatcher.decorators = [
775
- { type: core.Injectable }
776
- ];
777
- ChartDispatcher.ctorParameters = function () { return [
778
- { type: Boolean, decorators: [{ type: core.Inject, args: [ESC_LOGS,] }] }
779
- ]; };
780
-
781
676
  /** @ignore */
782
677
  var _spiritedaway = 'spiritedaway';
783
678
  /** @ignore */
@@ -1119,6 +1014,111 @@
1119
1014
  return ChartLoader;
1120
1015
  }());
1121
1016
 
1017
+ /**
1018
+ * Token che identifica il Locale di default per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
1019
+ */
1020
+ var ESC_LOCALE = new core.InjectionToken('ESC_LOCALE');
1021
+ /**
1022
+ * Token che identifica il default per l'utilizzo o meno delle Animazioni per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
1023
+ */
1024
+ var ESC_ANIMATIONS = new core.InjectionToken('ESC_ANIMATIONS');
1025
+ /**
1026
+ * Token che identifica il Tema di default per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
1027
+ */
1028
+ var ESC_THEME = new core.InjectionToken('ESC_THEME');
1029
+ /**
1030
+ * Token che identifica l'utilizzo o meno del sistema di Log per l'intera libreria
1031
+ */
1032
+ var ESC_LOGS = new core.InjectionToken('ESC_LOGS');
1033
+
1034
+ /**
1035
+ * Classe che si occupa del dispatch delle operazioni di rendering dei grafici utilizzando una coda per permettere ad ogni grafico di avere temi e localizzazione custom
1036
+ */
1037
+ var ChartDispatcher = /** @class */ (function () {
1038
+ /**
1039
+ * @ignore
1040
+ */
1041
+ function ChartDispatcher(logs) {
1042
+ this.logs = logs;
1043
+ /**
1044
+ * Coda di inizializzazioni ancora da eseguire. Quando questa è vuota significa che nessuno sta creando grafici
1045
+ */
1046
+ this.Initializations = [];
1047
+ /**
1048
+ * Lista dei grafici inizializzati e attivi in un dato momento (viene registrata la proprietà **name**). Non è possibile registrare due grafici con lo stesso identificativo
1049
+ */
1050
+ this.InitializedGraphs = [];
1051
+ }
1052
+ /**
1053
+ * Registra un grafico da visualizzare insieme alla propria funzione di creazione. Quest'ultima sarà differita fino a che tutti i grafici
1054
+ * precedentemente registati non hanno finito la fase di inizializzazione
1055
+ *
1056
+ * @param {string} name Identificativo del grafico da registrare
1057
+ * @param {Function} chartCreationFunction Funzione che fisicamente dovrà occuparsi della creazione del grafico
1058
+ */
1059
+ ChartDispatcher.prototype.register = function (name, chartCreationFunction) {
1060
+ if (this.InitializedGraphs.indexOf(name) != -1)
1061
+ throw "Attempting to register a duplicate chart '" + name + "'. Make sure the 'name' properties of your charts are univoque";
1062
+ this.log("DISPATCHER: Registering chart creation function execution for " + name);
1063
+ this.Initializations.push({ name: name, function: chartCreationFunction });
1064
+ if (this.Initializations.length == 1) {
1065
+ this.log("DISPATCHER: Initial drain started");
1066
+ this.drainInitQueues();
1067
+ }
1068
+ };
1069
+ /**
1070
+ * Deregistra un grafico presente. Chiamata generalmente al dispose del grafico in questione quando non dev'essere più mostrato nella pagina corrente
1071
+ *
1072
+ * @param {string} name Identificativo del grafico da deregistrare
1073
+ */
1074
+ ChartDispatcher.prototype.deregisterGraph = function (name) {
1075
+ var index = this.InitializedGraphs.indexOf(name);
1076
+ if (index == -1) {
1077
+ //Questo succede quando si cerca di distruggere il grafico mentre sta venendo graficato
1078
+ this.log("DISPATCHER: Registration missing for chart " + name + " it was probably destroyed during load");
1079
+ return;
1080
+ }
1081
+ this.log("DISPATCHER: Chart deregistered " + name);
1082
+ this.InitializedGraphs.splice(index, 1);
1083
+ };
1084
+ /**
1085
+ * Metodo che esegue in maniera sequenziale le funzioni di inizializzazione dei grafici finché presenti
1086
+ * in modo che nessun grafico possa essere inizializzato contemporaneamente ad un altro.
1087
+ *
1088
+ * Questo è il punto chiave che permette di avere per ogni grafico temi e locale differenti
1089
+ */
1090
+ ChartDispatcher.prototype.drainInitQueues = function () {
1091
+ var _this = this;
1092
+ var toExecute = this.Initializations[0];
1093
+ this.log("DISPATCHER: Executing initialization function for chart " + toExecute.name);
1094
+ toExecute.function().then(function () {
1095
+ _this.log("DISPATCHER: initialization for chart " + toExecute.name + " is done");
1096
+ _this.InitializedGraphs.push(toExecute.name);
1097
+ _this.Initializations.splice(0, 1);
1098
+ if (_this.Initializations.length >= 1) {
1099
+ _this.log("DISPATCHER: Found queued initializations. Continuing");
1100
+ _this.drainInitQueues();
1101
+ }
1102
+ else
1103
+ _this.log("DISPATCHER: queue is over, nothing more to do");
1104
+ });
1105
+ };
1106
+ /**
1107
+ * @ignore
1108
+ */
1109
+ ChartDispatcher.prototype.log = function (text) {
1110
+ if (this.logs)
1111
+ console.log("@esfaenza/es-charts: " + text);
1112
+ };
1113
+ return ChartDispatcher;
1114
+ }());
1115
+ ChartDispatcher.decorators = [
1116
+ { type: core.Injectable }
1117
+ ];
1118
+ ChartDispatcher.ctorParameters = function () { return [
1119
+ { type: Boolean, decorators: [{ type: core.Inject, args: [ESC_LOGS,] }] }
1120
+ ]; };
1121
+
1122
1122
  /**
1123
1123
  * Componente Grafico Base che gestisce tutte le cose comuni dei vari grafici istanziabili, come la presenza o menu di una legenda,
1124
1124
  * il tema utilizzato, il locale del singolo grafico, ecc ecc...
@@ -1702,26 +1702,7 @@
1702
1702
  this.ChartInstance.addData(data);
1703
1703
  return;
1704
1704
  }
1705
- this.ChartInstance.series.each(function (s) {
1706
- var relativeSerie = dataConverted.series.find(function (t) { return t.name == s.name; });
1707
- // Una serie del grafico è stata ggiornata, ordino i datapoint e li aggiungo
1708
- var correctOrder = true;
1709
- var prevDate = null;
1710
- for (var v = 0; v < relativeSerie.values.length; v++) {
1711
- if (!prevDate)
1712
- prevDate = relativeSerie.values[v].d;
1713
- else if (relativeSerie.values[v].d < prevDate) {
1714
- correctOrder = false;
1715
- break;
1716
- }
1717
- }
1718
- if (!correctOrder)
1719
- relativeSerie.values.sort(function (d1, d2) { return d1.d.getTime() - d2.d.getTime(); });
1720
- for (var v = 0; v < relativeSerie.values.length; v++) {
1721
- var obj = relativeSerie.values[v];
1722
- s.addData({ date: obj.d, value: obj.v });
1723
- }
1724
- });
1705
+ throw "Impossibile aggiornare i dati senza unire il dataset. Si prega di impostare [MergeDatasets] a true";
1725
1706
  };
1726
1707
  /** Partendo da dati divisi per seriue genera un dataset unito con la data come chiave e i vari valori dopo */
1727
1708
  LineChartService.prototype.generateSingleDataset = function (data) {
@@ -1811,158 +1792,22 @@
1811
1792
  }());
1812
1793
 
1813
1794
  /**
1814
- * Classe il cui unico scopo è gestire il setup e rendering di un AreaChart
1795
+ * Classe il cui unico scopo è gestire il setup e rendering di un PieChart
1815
1796
  */
1816
- var AreaChartService = /** @class */ (function () {
1797
+ var PieChartService = /** @class */ (function () {
1817
1798
  /** @ignore */
1818
- function AreaChartService(Adapter) {
1799
+ function PieChartService(Adapter) {
1819
1800
  this.Adapter = Adapter;
1820
- //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
1821
- //TODO: spostarla in un metodo di utilità (esfaenza/extensions)
1822
1801
  /** @ignore */
1823
- this.executionTimers = {};
1802
+ this.ViewAbsoluteValues = true;
1824
1803
  }
1825
1804
  /**
1826
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un AreaChart
1805
+ * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un PieChart
1827
1806
  */
1828
- AreaChartService.prototype.graphicate = function (data, settings) {
1829
- var _this = this;
1830
- var _a, _b, _c, _d, _e, _f;
1807
+ PieChartService.prototype.graphicate = function (data, settings) {
1808
+ var _a, _b, _c, _d;
1831
1809
  if (settings.Timeline) {
1832
- console.error("Timeline not supported for area chart");
1833
- return null;
1834
- }
1835
- var dataConverted = this.Adapter ? this.Adapter.adaptDataForAreaChart(data) : data;
1836
- var showTicks = settings.ShowTicks == null ? true : settings === null || settings === void 0 ? void 0 : settings.ShowTicks;
1837
- var interval = dataConverted.interval;
1838
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1839
- am4core__namespace.options.autoDispose = true;
1840
- this.ChartInstance = am4core__namespace.create(settings.Name, am4charts__namespace.XYChart);
1841
- var ChartInstanceCasted = this.ChartInstance;
1842
- if (settings.Legend) {
1843
- ChartInstanceCasted.legend = new am4charts__namespace.Legend();
1844
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1845
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1846
- if (settings.LegendPadding) {
1847
- var template = this.ChartInstance.legend.itemContainers.template;
1848
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1849
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1850
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1851
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1852
- }
1853
- }
1854
- var yAxis = ChartInstanceCasted.yAxes.push(new am4charts__namespace.ValueAxis());
1855
- yAxis.tooltip.disabled = true;
1856
- if (settings.YAxisTitle) {
1857
- yAxis.title.text = settings.YAxisTitle;
1858
- yAxis.title.fontWeight = "bold";
1859
- }
1860
- yAxis.min = 0;
1861
- var dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
1862
- dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
1863
- dateAxis.startLocation = 0.5;
1864
- dateAxis.endLocation = 0.5;
1865
- if (settings.XAxisTitle) {
1866
- dateAxis.title.text = settings.XAxisTitle;
1867
- dateAxis.title.fontWeight = "bold";
1868
- }
1869
- if (showTicks) {
1870
- dateAxis.renderer.ticks.template.disabled = false;
1871
- dateAxis.renderer.ticks.template.strokeOpacity = 1;
1872
- dateAxis.renderer.ticks.template.stroke = am4core__namespace.color("#495C43");
1873
- dateAxis.renderer.ticks.template.strokeWidth = 2;
1874
- dateAxis.renderer.ticks.template.length = 10;
1875
- dateAxis.renderer.ticks.template.location = 0;
1876
- }
1877
- if (!!interval)
1878
- dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
1879
- // Unisco il dataset e tiro fuori i dati
1880
- var chartData = [];
1881
- var seriesToMakeCache = {};
1882
- var seriesToMake = [];
1883
- for (var i = 0; i < dataConverted.groups.length; i++) {
1884
- var group = dataConverted.groups[i];
1885
- var dataItem = { date: group.name };
1886
- for (var ii = 0; ii < group.values.length; ii++) {
1887
- var val = group.values[ii];
1888
- dataItem[val.k] = val.v;
1889
- if (!seriesToMakeCache[val.k]) {
1890
- seriesToMakeCache[val.k] = true;
1891
- seriesToMake.push(val.k);
1892
- }
1893
- }
1894
- chartData.push(dataItem);
1895
- }
1896
- ChartInstanceCasted.data = chartData;
1897
- //---------------------------------------------------------
1898
- seriesToMake.forEach(function (s) { _this.createSeries(ChartInstanceCasted, s); });
1899
- ChartInstanceCasted.cursor = new am4charts__namespace.XYCursor();
1900
- ChartInstanceCasted.cursor.xAxis = dateAxis;
1901
- dateAxis.events.on("startchanged", function (t) { return _this.emitSelectionChanged(t, settings); });
1902
- dateAxis.events.on("endchanged", function (t) { return _this.emitSelectionChanged(t, settings); });
1903
- return this;
1904
- };
1905
- /** @ignore */
1906
- AreaChartService.prototype.refreshData = function (data) {
1907
- //TODO:IMPL
1908
- };
1909
- /** @ignore */
1910
- AreaChartService.prototype.emitSelectionChanged = function (ev, settings) {
1911
- if (settings.OnSelectionChangedCallback) {
1912
- this.throttla("selchange", function () {
1913
- var axis = ev.target;
1914
- var start = new Date(axis.minZoomed);
1915
- var end = new Date(axis.maxZoomed);
1916
- var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
1917
- settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
1918
- }, 150);
1919
- }
1920
- };
1921
- /** @ignore */
1922
- AreaChartService.prototype.createSeries = function (chart, name) {
1923
- var series = chart.series.push(new am4charts__namespace.LineSeries());
1924
- series.dataFields.dateX = "date";
1925
- series.name = name[0].toUpperCase() + name.slice(1);
1926
- series.dataFields.valueY = name;
1927
- series.tooltipText = "[#000]{valueY.value}[/]";
1928
- //series.tooltip.background.fill = am4core.color("#FFF");
1929
- series.tooltip.getStrokeFromObject = true;
1930
- series.tooltip.background.strokeWidth = 3;
1931
- series.tooltip.getFillFromObject = false;
1932
- series.fillOpacity = 0.6;
1933
- series.strokeWidth = 2;
1934
- series.stacked = true;
1935
- return series;
1936
- };
1937
- /** @ignore */
1938
- AreaChartService.prototype.throttla = function (id, func, throttleTime) {
1939
- var _this = this;
1940
- //Se ho la funzione che vuole eseguire ripulisco quel timeout
1941
- if (this.executionTimers[id])
1942
- clearTimeout(this.executionTimers[id]);
1943
- //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
1944
- this.executionTimers[id] = setTimeout(function () { func(); _this.executionTimers[id] = null; }, throttleTime);
1945
- };
1946
- return AreaChartService;
1947
- }());
1948
-
1949
- /**
1950
- * Classe il cui unico scopo è gestire il setup e rendering di un PieChart
1951
- */
1952
- var PieChartService = /** @class */ (function () {
1953
- /** @ignore */
1954
- function PieChartService(Adapter) {
1955
- this.Adapter = Adapter;
1956
- /** @ignore */
1957
- this.ViewAbsoluteValues = true;
1958
- }
1959
- /**
1960
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un PieChart
1961
- */
1962
- PieChartService.prototype.graphicate = function (data, settings) {
1963
- var _a, _b, _c, _d;
1964
- if (settings.Timeline) {
1965
- console.error("Timeline not supported for pie chart");
1810
+ console.error("Timeline not supported for pie chart");
1966
1811
  return null;
1967
1812
  }
1968
1813
  //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
@@ -2057,6 +1902,111 @@
2057
1902
  return PieChartService;
2058
1903
  }());
2059
1904
 
1905
+ /**
1906
+ * Classe il cui unico scopo è gestire il setup e rendering di un VerticalChart
1907
+ */
1908
+ var VerticalChartService = /** @class */ (function () {
1909
+ /** @ignore */
1910
+ function VerticalChartService(Adapter) {
1911
+ this.Adapter = Adapter;
1912
+ /** @ignore */
1913
+ this.dangerZone = 50;
1914
+ /** @ignore */
1915
+ this.LabelWidth = 150;
1916
+ /** @ignore */
1917
+ this.LabelRightWhenCompressed = 20;
1918
+ /** @ignore */
1919
+ this.LabelTopWhenCompressed = -5;
1920
+ /** @ignore */
1921
+ this.DefaultColumnWidthPercentage = 85;
1922
+ }
1923
+ /**
1924
+ * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalChart
1925
+ */
1926
+ VerticalChartService.prototype.graphicate = function (data, settings) {
1927
+ var _this = this;
1928
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1929
+ if (settings.Timeline) {
1930
+ console.error("Timeline not supported for vertical chart");
1931
+ return null;
1932
+ }
1933
+ //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1934
+ am4core__namespace.options.autoDispose = true;
1935
+ this.ChartInstance = am4core__namespace.create(settings.Name, am4charts__namespace.XYChart);
1936
+ var ChartInstanceCasted = this.ChartInstance;
1937
+ var dataConverted = this.Adapter ? this.Adapter.adaptDataForVerticalChart(data) : data;
1938
+ ChartInstanceCasted.data = dataConverted.values;
1939
+ if (settings.Legend) {
1940
+ ChartInstanceCasted.legend = new am4charts__namespace.Legend();
1941
+ ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1942
+ ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1943
+ if (settings.LegendPadding) {
1944
+ var template = this.ChartInstance.legend.itemContainers.template;
1945
+ template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1946
+ template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1947
+ template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1948
+ template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1949
+ }
1950
+ }
1951
+ var yAxis = ChartInstanceCasted.yAxes.push(new am4charts__namespace.ValueAxis());
1952
+ if (settings.YAxisTitle) {
1953
+ yAxis.title.text = settings.YAxisTitle;
1954
+ yAxis.title.fontWeight = "bold";
1955
+ }
1956
+ var categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.CategoryAxis());
1957
+ if (settings.XAxisTitle) {
1958
+ categoryAxis.title.text = settings.XAxisTitle;
1959
+ categoryAxis.title.fontWeight = "bold";
1960
+ }
1961
+ categoryAxis.dataFields.category = "k";
1962
+ categoryAxis.renderer.grid.template.location = 0;
1963
+ categoryAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 30;
1964
+ var label = categoryAxis.renderer.labels.template;
1965
+ label.truncate = true;
1966
+ label.maxWidth = (_g = settings.LabelWidth) !== null && _g !== void 0 ? _g : this.LabelWidth;
1967
+ label.tooltipText = "{category}";
1968
+ if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1969
+ categoryAxis.events.on("sizechanged", function (ev) {
1970
+ var _a, _b, _c;
1971
+ var axis = ev.target;
1972
+ var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1973
+ if (cellWidth < axis.renderer.labels.template.maxWidth) {
1974
+ var areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : _this.dangerZone);
1975
+ axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1976
+ axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : _this.LabelRightWhenCompressed;
1977
+ axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : _this.LabelTopWhenCompressed;
1978
+ axis.renderer.labels.template.horizontalCenter = "right";
1979
+ axis.renderer.labels.template.verticalCenter = "middle";
1980
+ }
1981
+ else {
1982
+ axis.renderer.labels.template.rotation = 0;
1983
+ axis.renderer.labels.template.dx = 0;
1984
+ axis.renderer.labels.template.dy = 0;
1985
+ axis.renderer.labels.template.horizontalCenter = "middle";
1986
+ axis.renderer.labels.template.verticalCenter = "top";
1987
+ }
1988
+ });
1989
+ }
1990
+ // Create series
1991
+ var series = ChartInstanceCasted.series.push(new am4charts__namespace.ColumnSeries());
1992
+ series.dataFields.valueY = "v";
1993
+ series.dataFields.categoryX = "k";
1994
+ series.name = "";
1995
+ series.columns.template.tooltipText = "{categoryX}: [bold]{valueY}[/]";
1996
+ series.columns.template.fillOpacity = .8;
1997
+ series.columns.template.width = am4core__namespace.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
1998
+ var columnTemplate = series.columns.template;
1999
+ columnTemplate.strokeWidth = 2;
2000
+ columnTemplate.strokeOpacity = 1;
2001
+ return this;
2002
+ };
2003
+ /** @ignore */
2004
+ VerticalChartService.prototype.refreshData = function (data) {
2005
+ //TODO:IMPL
2006
+ };
2007
+ return VerticalChartService;
2008
+ }());
2009
+
2060
2010
  /**
2061
2011
  * Classe il cui unico scopo è gestire il setup e rendering di un Vertical2DChart
2062
2012
  */
@@ -2221,111 +2171,6 @@
2221
2171
  return Vertical2DChartService;
2222
2172
  }());
2223
2173
 
2224
- /**
2225
- * Classe il cui unico scopo è gestire il setup e rendering di un VerticalChart
2226
- */
2227
- var VerticalChartService = /** @class */ (function () {
2228
- /** @ignore */
2229
- function VerticalChartService(Adapter) {
2230
- this.Adapter = Adapter;
2231
- /** @ignore */
2232
- this.dangerZone = 50;
2233
- /** @ignore */
2234
- this.LabelWidth = 150;
2235
- /** @ignore */
2236
- this.LabelRightWhenCompressed = 20;
2237
- /** @ignore */
2238
- this.LabelTopWhenCompressed = -5;
2239
- /** @ignore */
2240
- this.DefaultColumnWidthPercentage = 85;
2241
- }
2242
- /**
2243
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalChart
2244
- */
2245
- VerticalChartService.prototype.graphicate = function (data, settings) {
2246
- var _this = this;
2247
- var _a, _b, _c, _d, _e, _f, _g, _h;
2248
- if (settings.Timeline) {
2249
- console.error("Timeline not supported for vertical chart");
2250
- return null;
2251
- }
2252
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
2253
- am4core__namespace.options.autoDispose = true;
2254
- this.ChartInstance = am4core__namespace.create(settings.Name, am4charts__namespace.XYChart);
2255
- var ChartInstanceCasted = this.ChartInstance;
2256
- var dataConverted = this.Adapter ? this.Adapter.adaptDataForVerticalChart(data) : data;
2257
- ChartInstanceCasted.data = dataConverted.values;
2258
- if (settings.Legend) {
2259
- ChartInstanceCasted.legend = new am4charts__namespace.Legend();
2260
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
2261
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
2262
- if (settings.LegendPadding) {
2263
- var template = this.ChartInstance.legend.itemContainers.template;
2264
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
2265
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
2266
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
2267
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
2268
- }
2269
- }
2270
- var yAxis = ChartInstanceCasted.yAxes.push(new am4charts__namespace.ValueAxis());
2271
- if (settings.YAxisTitle) {
2272
- yAxis.title.text = settings.YAxisTitle;
2273
- yAxis.title.fontWeight = "bold";
2274
- }
2275
- var categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.CategoryAxis());
2276
- if (settings.XAxisTitle) {
2277
- categoryAxis.title.text = settings.XAxisTitle;
2278
- categoryAxis.title.fontWeight = "bold";
2279
- }
2280
- categoryAxis.dataFields.category = "k";
2281
- categoryAxis.renderer.grid.template.location = 0;
2282
- categoryAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 30;
2283
- var label = categoryAxis.renderer.labels.template;
2284
- label.truncate = true;
2285
- label.maxWidth = (_g = settings.LabelWidth) !== null && _g !== void 0 ? _g : this.LabelWidth;
2286
- label.tooltipText = "{category}";
2287
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
2288
- categoryAxis.events.on("sizechanged", function (ev) {
2289
- var _a, _b, _c;
2290
- var axis = ev.target;
2291
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
2292
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
2293
- var areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : _this.dangerZone);
2294
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
2295
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : _this.LabelRightWhenCompressed;
2296
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : _this.LabelTopWhenCompressed;
2297
- axis.renderer.labels.template.horizontalCenter = "right";
2298
- axis.renderer.labels.template.verticalCenter = "middle";
2299
- }
2300
- else {
2301
- axis.renderer.labels.template.rotation = 0;
2302
- axis.renderer.labels.template.dx = 0;
2303
- axis.renderer.labels.template.dy = 0;
2304
- axis.renderer.labels.template.horizontalCenter = "middle";
2305
- axis.renderer.labels.template.verticalCenter = "top";
2306
- }
2307
- });
2308
- }
2309
- // Create series
2310
- var series = ChartInstanceCasted.series.push(new am4charts__namespace.ColumnSeries());
2311
- series.dataFields.valueY = "v";
2312
- series.dataFields.categoryX = "k";
2313
- series.name = "";
2314
- series.columns.template.tooltipText = "{categoryX}: [bold]{valueY}[/]";
2315
- series.columns.template.fillOpacity = .8;
2316
- series.columns.template.width = am4core__namespace.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
2317
- var columnTemplate = series.columns.template;
2318
- columnTemplate.strokeWidth = 2;
2319
- columnTemplate.strokeOpacity = 1;
2320
- return this;
2321
- };
2322
- /** @ignore */
2323
- VerticalChartService.prototype.refreshData = function (data) {
2324
- //TODO:IMPL
2325
- };
2326
- return VerticalChartService;
2327
- }());
2328
-
2329
2174
  /**
2330
2175
  * Classe il cui unico scopo è gestire il setup e rendering di un VerticalStackedChart
2331
2176
  */
@@ -2453,6 +2298,142 @@
2453
2298
  return VerticalStackedChartService;
2454
2299
  }());
2455
2300
 
2301
+ /**
2302
+ * Classe il cui unico scopo è gestire il setup e rendering di un AreaChart
2303
+ */
2304
+ var AreaChartService = /** @class */ (function () {
2305
+ /** @ignore */
2306
+ function AreaChartService(Adapter) {
2307
+ this.Adapter = Adapter;
2308
+ //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
2309
+ //TODO: spostarla in un metodo di utilità (esfaenza/extensions)
2310
+ /** @ignore */
2311
+ this.executionTimers = {};
2312
+ }
2313
+ /**
2314
+ * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un AreaChart
2315
+ */
2316
+ AreaChartService.prototype.graphicate = function (data, settings) {
2317
+ var _this = this;
2318
+ var _a, _b, _c, _d, _e, _f;
2319
+ if (settings.Timeline) {
2320
+ console.error("Timeline not supported for area chart");
2321
+ return null;
2322
+ }
2323
+ var dataConverted = this.Adapter ? this.Adapter.adaptDataForAreaChart(data) : data;
2324
+ var showTicks = settings.ShowTicks == null ? true : settings === null || settings === void 0 ? void 0 : settings.ShowTicks;
2325
+ var interval = dataConverted.interval;
2326
+ //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
2327
+ am4core__namespace.options.autoDispose = true;
2328
+ this.ChartInstance = am4core__namespace.create(settings.Name, am4charts__namespace.XYChart);
2329
+ var ChartInstanceCasted = this.ChartInstance;
2330
+ if (settings.Legend) {
2331
+ ChartInstanceCasted.legend = new am4charts__namespace.Legend();
2332
+ ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
2333
+ ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
2334
+ if (settings.LegendPadding) {
2335
+ var template = this.ChartInstance.legend.itemContainers.template;
2336
+ template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
2337
+ template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
2338
+ template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
2339
+ template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
2340
+ }
2341
+ }
2342
+ var yAxis = ChartInstanceCasted.yAxes.push(new am4charts__namespace.ValueAxis());
2343
+ yAxis.tooltip.disabled = true;
2344
+ if (settings.YAxisTitle) {
2345
+ yAxis.title.text = settings.YAxisTitle;
2346
+ yAxis.title.fontWeight = "bold";
2347
+ }
2348
+ yAxis.min = 0;
2349
+ var dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
2350
+ dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
2351
+ dateAxis.startLocation = 0.5;
2352
+ dateAxis.endLocation = 0.5;
2353
+ if (settings.XAxisTitle) {
2354
+ dateAxis.title.text = settings.XAxisTitle;
2355
+ dateAxis.title.fontWeight = "bold";
2356
+ }
2357
+ if (showTicks) {
2358
+ dateAxis.renderer.ticks.template.disabled = false;
2359
+ dateAxis.renderer.ticks.template.strokeOpacity = 1;
2360
+ dateAxis.renderer.ticks.template.stroke = am4core__namespace.color("#495C43");
2361
+ dateAxis.renderer.ticks.template.strokeWidth = 2;
2362
+ dateAxis.renderer.ticks.template.length = 10;
2363
+ dateAxis.renderer.ticks.template.location = 0;
2364
+ }
2365
+ if (!!interval)
2366
+ dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
2367
+ // Unisco il dataset e tiro fuori i dati
2368
+ var chartData = [];
2369
+ var seriesToMakeCache = {};
2370
+ var seriesToMake = [];
2371
+ for (var i = 0; i < dataConverted.groups.length; i++) {
2372
+ var group = dataConverted.groups[i];
2373
+ var dataItem = { date: group.name };
2374
+ for (var ii = 0; ii < group.values.length; ii++) {
2375
+ var val = group.values[ii];
2376
+ dataItem[val.k] = val.v;
2377
+ if (!seriesToMakeCache[val.k]) {
2378
+ seriesToMakeCache[val.k] = true;
2379
+ seriesToMake.push(val.k);
2380
+ }
2381
+ }
2382
+ chartData.push(dataItem);
2383
+ }
2384
+ ChartInstanceCasted.data = chartData;
2385
+ //---------------------------------------------------------
2386
+ seriesToMake.forEach(function (s) { _this.createSeries(ChartInstanceCasted, s); });
2387
+ ChartInstanceCasted.cursor = new am4charts__namespace.XYCursor();
2388
+ ChartInstanceCasted.cursor.xAxis = dateAxis;
2389
+ dateAxis.events.on("startchanged", function (t) { return _this.emitSelectionChanged(t, settings); });
2390
+ dateAxis.events.on("endchanged", function (t) { return _this.emitSelectionChanged(t, settings); });
2391
+ return this;
2392
+ };
2393
+ /** @ignore */
2394
+ AreaChartService.prototype.refreshData = function (data) {
2395
+ //TODO:IMPL
2396
+ };
2397
+ /** @ignore */
2398
+ AreaChartService.prototype.emitSelectionChanged = function (ev, settings) {
2399
+ if (settings.OnSelectionChangedCallback) {
2400
+ this.throttla("selchange", function () {
2401
+ var axis = ev.target;
2402
+ var start = new Date(axis.minZoomed);
2403
+ var end = new Date(axis.maxZoomed);
2404
+ var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
2405
+ settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
2406
+ }, 150);
2407
+ }
2408
+ };
2409
+ /** @ignore */
2410
+ AreaChartService.prototype.createSeries = function (chart, name) {
2411
+ var series = chart.series.push(new am4charts__namespace.LineSeries());
2412
+ series.dataFields.dateX = "date";
2413
+ series.name = name[0].toUpperCase() + name.slice(1);
2414
+ series.dataFields.valueY = name;
2415
+ series.tooltipText = "[#000]{valueY.value}[/]";
2416
+ //series.tooltip.background.fill = am4core.color("#FFF");
2417
+ series.tooltip.getStrokeFromObject = true;
2418
+ series.tooltip.background.strokeWidth = 3;
2419
+ series.tooltip.getFillFromObject = false;
2420
+ series.fillOpacity = 0.6;
2421
+ series.strokeWidth = 2;
2422
+ series.stacked = true;
2423
+ return series;
2424
+ };
2425
+ /** @ignore */
2426
+ AreaChartService.prototype.throttla = function (id, func, throttleTime) {
2427
+ var _this = this;
2428
+ //Se ho la funzione che vuole eseguire ripulisco quel timeout
2429
+ if (this.executionTimers[id])
2430
+ clearTimeout(this.executionTimers[id]);
2431
+ //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
2432
+ this.executionTimers[id] = setTimeout(function () { func(); _this.executionTimers[id] = null; }, throttleTime);
2433
+ };
2434
+ return AreaChartService;
2435
+ }());
2436
+
2456
2437
  /**
2457
2438
  * Componente specifico per la graficazione di un qualsiasi tipo di grafico.
2458
2439
  *
@@ -3236,22 +3217,13 @@
3236
3217
  exports.VerticalChartSettings = VerticalChartSettings;
3237
3218
  exports.VerticalStackedChartData = VerticalStackedChartData;
3238
3219
  exports.VerticalStackedChartSettings = VerticalStackedChartSettings;
3239
- exports.ɵa = BaseInterval;
3240
- exports.ɵb = ChartLoader;
3241
- exports.ɵc = ChartDispatcher;
3242
- exports.ɵd = ESC_LOCALE;
3243
- exports.ɵe = ESC_ANIMATIONS;
3244
- exports.ɵf = ESC_THEME;
3245
- exports.ɵg = ESC_LOGS;
3246
- exports.ɵh = BaseAdapter;
3247
- exports.ɵi = EsChartComponent;
3248
- exports.ɵj = EsLineChartComponent;
3249
- exports.ɵk = EsPieChartComponent;
3250
- exports.ɵl = EsVertical2DChartComponent;
3251
- exports.ɵm = EsVerticalChartComponent;
3252
- exports.ɵn = EsVerticalStackedChartComponent;
3253
- exports.ɵo = PageChartSelector;
3254
- exports.ɵp = EsAreaChartComponent;
3220
+ exports.ɵa = ChartLoader;
3221
+ exports.ɵb = ChartDispatcher;
3222
+ exports.ɵc = ESC_LOCALE;
3223
+ exports.ɵd = ESC_ANIMATIONS;
3224
+ exports.ɵe = ESC_THEME;
3225
+ exports.ɵf = ESC_LOGS;
3226
+ exports.ɵg = PageChartSelector;
3255
3227
 
3256
3228
  Object.defineProperty(exports, '__esModule', { value: true });
3257
3229