@esfaenza/es-charts 15.2.7 → 16.2.0

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 (102) hide show
  1. package/{esm2020 → esm2022}/esfaenza-es-charts.mjs +4 -4
  2. package/{esm2020 → esm2022}/lib/adapters/BaseAdapter.mjs +50 -50
  3. package/{esm2020 → esm2022}/lib/adapters/IBaseAdapter.mjs +1 -1
  4. package/{esm2020 → esm2022}/lib/components/base/base-chart.component.mjs +350 -350
  5. package/{esm2020 → esm2022}/lib/components/chart-pager/chart-pager.component.mjs +89 -89
  6. package/{esm2020 → esm2022}/lib/components/specializations/es-area-chart.component.mjs +77 -77
  7. package/{esm2020 → esm2022}/lib/components/specializations/es-chart.component.mjs +122 -122
  8. package/{esm2020 → esm2022}/lib/components/specializations/es-line-chart.component.mjs +112 -112
  9. package/{esm2020 → esm2022}/lib/components/specializations/es-pie-chart.component.mjs +98 -98
  10. package/{esm2020 → esm2022}/lib/components/specializations/es-vertical-2d-chart.component.mjs +95 -95
  11. package/{esm2020 → esm2022}/lib/components/specializations/es-vertical-chart.component.mjs +92 -92
  12. package/{esm2020 → esm2022}/lib/components/specializations/es-vertical-stacked-chart.component.mjs +92 -92
  13. package/{esm2020 → esm2022}/lib/es-charts.module.mjs +67 -67
  14. package/{esm2020 → esm2022}/lib/models/EsChaartsModuleConfig.mjs +5 -5
  15. package/{esm2020 → esm2022}/lib/models/core/ChartDispatcher.mjs +91 -91
  16. package/{esm2020 → esm2022}/lib/models/core/ChartLoader.mjs +212 -212
  17. package/{esm2020 → esm2022}/lib/models/core/ChartThemes.mjs +60 -60
  18. package/{esm2020 → esm2022}/lib/models/data/AreaChartData.mjs +15 -15
  19. package/{esm2020 → esm2022}/lib/models/data/LineChartData.mjs +15 -15
  20. package/{esm2020 → esm2022}/lib/models/data/PagedChartData.mjs +19 -19
  21. package/{esm2020 → esm2022}/lib/models/data/PieChartData.mjs +13 -13
  22. package/{esm2020 → esm2022}/lib/models/data/Vertical2DChartData.mjs +15 -15
  23. package/{esm2020 → esm2022}/lib/models/data/VerticalChartData.mjs +13 -13
  24. package/{esm2020 → esm2022}/lib/models/data/VerticalStackedChartData.mjs +13 -13
  25. package/{esm2020 → esm2022}/lib/models/data/base/DateValue.mjs +10 -10
  26. package/{esm2020 → esm2022}/lib/models/data/base/KeyValue.mjs +10 -10
  27. package/{esm2020 → esm2022}/lib/models/data/base/KeyValueColor.mjs +12 -12
  28. package/{esm2020 → esm2022}/lib/models/data/base/Limit.mjs +15 -15
  29. package/{esm2020 → esm2022}/lib/models/data/base/LineSerie.mjs +27 -27
  30. package/{esm2020 → esm2022}/lib/models/settings/AreaChartSettings.mjs +10 -10
  31. package/{esm2020 → esm2022}/lib/models/settings/LineChartSettings.mjs +10 -10
  32. package/{esm2020 → esm2022}/lib/models/settings/PieChartSettings.mjs +6 -6
  33. package/{esm2020 → esm2022}/lib/models/settings/Vertical2DChartSettings.mjs +10 -10
  34. package/{esm2020 → esm2022}/lib/models/settings/VerticalChartSettings.mjs +10 -10
  35. package/{esm2020 → esm2022}/lib/models/settings/VerticalStackedChartSettings.mjs +10 -10
  36. package/{esm2020 → esm2022}/lib/models/settings/base/BaseInterval.mjs +5 -5
  37. package/{esm2020 → esm2022}/lib/models/settings/base/BaseSettings.mjs +5 -5
  38. package/{esm2020 → esm2022}/lib/models/settings/base/LegendPad.mjs +5 -5
  39. package/esm2022/lib/services/AreaChartService.mjs +157 -0
  40. package/esm2022/lib/services/LineChartService.mjs +392 -0
  41. package/{esm2020 → esm2022}/lib/services/PieChartService.mjs +113 -113
  42. package/{esm2020 → esm2022}/lib/services/Vertical2DChartService.mjs +162 -162
  43. package/{esm2020 → esm2022}/lib/services/VerticalChartService.mjs +113 -113
  44. package/{esm2020 → esm2022}/lib/services/VerticalStackedChartService.mjs +126 -126
  45. package/{esm2020 → esm2022}/lib/services/base/IBaseService.mjs +1 -1
  46. package/{esm2020 → esm2022}/lib/tokens.mjs +13 -13
  47. package/{esm2020 → esm2022}/public-api.mjs +38 -38
  48. package/{fesm2020 → fesm2022}/esfaenza-es-charts.mjs +2728 -2688
  49. package/fesm2022/esfaenza-es-charts.mjs.map +1 -0
  50. package/index.d.ts +5 -5
  51. package/lib/adapters/BaseAdapter.d.ts +40 -40
  52. package/lib/adapters/IBaseAdapter.d.ts +35 -35
  53. package/lib/components/base/base-chart.component.d.ts +304 -304
  54. package/lib/components/chart-pager/chart-pager.component.d.ts +70 -70
  55. package/lib/components/specializations/es-area-chart.component.d.ts +53 -53
  56. package/lib/components/specializations/es-chart.component.d.ts +71 -71
  57. package/lib/components/specializations/es-line-chart.component.d.ts +112 -112
  58. package/lib/components/specializations/es-pie-chart.component.d.ts +81 -81
  59. package/lib/components/specializations/es-vertical-2d-chart.component.d.ts +79 -79
  60. package/lib/components/specializations/es-vertical-chart.component.d.ts +74 -74
  61. package/lib/components/specializations/es-vertical-stacked-chart.component.d.ts +74 -74
  62. package/lib/es-charts.module.d.ts +18 -18
  63. package/lib/models/EsChaartsModuleConfig.d.ts +24 -24
  64. package/lib/models/core/ChartDispatcher.d.ts +46 -46
  65. package/lib/models/core/ChartLoader.d.ts +92 -92
  66. package/lib/models/core/ChartThemes.d.ts +23 -23
  67. package/lib/models/data/AreaChartData.d.ts +22 -22
  68. package/lib/models/data/LineChartData.d.ts +16 -16
  69. package/lib/models/data/PagedChartData.d.ts +23 -23
  70. package/lib/models/data/PieChartData.d.ts +13 -13
  71. package/lib/models/data/Vertical2DChartData.d.ts +27 -27
  72. package/lib/models/data/VerticalChartData.d.ts +13 -13
  73. package/lib/models/data/VerticalStackedChartData.d.ts +21 -21
  74. package/lib/models/data/base/DateValue.d.ts +9 -9
  75. package/lib/models/data/base/KeyValue.d.ts +9 -9
  76. package/lib/models/data/base/KeyValueColor.d.ts +11 -11
  77. package/lib/models/data/base/Limit.d.ts +14 -14
  78. package/lib/models/data/base/LineSerie.d.ts +28 -28
  79. package/lib/models/settings/AreaChartSettings.d.ts +10 -10
  80. package/lib/models/settings/LineChartSettings.d.ts +67 -67
  81. package/lib/models/settings/PieChartSettings.d.ts +34 -34
  82. package/lib/models/settings/Vertical2DChartSettings.d.ts +36 -36
  83. package/lib/models/settings/VerticalChartSettings.d.ts +31 -31
  84. package/lib/models/settings/VerticalStackedChartSettings.d.ts +31 -31
  85. package/lib/models/settings/base/BaseInterval.d.ts +13 -13
  86. package/lib/models/settings/base/BaseSettings.d.ts +67 -67
  87. package/lib/models/settings/base/LegendPad.d.ts +21 -21
  88. package/lib/services/AreaChartService.d.ts +32 -31
  89. package/lib/services/LineChartService.d.ts +48 -47
  90. package/lib/services/PieChartService.d.ts +27 -27
  91. package/lib/services/Vertical2DChartService.d.ts +39 -39
  92. package/lib/services/VerticalChartService.d.ts +33 -33
  93. package/lib/services/VerticalStackedChartService.d.ts +35 -35
  94. package/lib/services/base/IBaseService.d.ts +38 -38
  95. package/lib/tokens.d.ts +13 -13
  96. package/package.json +11 -17
  97. package/public-api.d.ts +35 -35
  98. package/esm2020/lib/services/AreaChartService.mjs +0 -137
  99. package/esm2020/lib/services/LineChartService.mjs +0 -372
  100. package/fesm2015/esfaenza-es-charts.mjs +0 -2829
  101. package/fesm2015/esfaenza-es-charts.mjs.map +0 -1
  102. package/fesm2020/esfaenza-es-charts.mjs.map +0 -1
@@ -1,2829 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ContentChild, InjectionToken, Inject, Directive, PLATFORM_ID, NgModule } from '@angular/core';
3
- import * as i5 from '@angular/common';
4
- import { isPlatformBrowser, CommonModule } from '@angular/common';
5
- import * as am4core from '@amcharts/amcharts4/core';
6
- import * as am4charts from '@amcharts/amcharts4/charts';
7
- import * as i3 from '@esfaenza/extensions';
8
- import * as i4 from '@esfaenza/localizations';
9
-
10
- /**
11
- * Adapter Base da reimplementare per trasformare i dati da una libreria di grafici a questa per evitare di riscrivere tutto il codice di
12
- * generazione delle serie in caso si fossero usati grafici di altre librerie
13
- */
14
- class BaseAdapter {
15
- /**
16
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per gli Area Chart
17
- */
18
- adaptDataForAreaChart(anyData) {
19
- return anyData;
20
- }
21
- /**
22
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per i Line Chart
23
- */
24
- adaptDataForLineChart(anyData) {
25
- return anyData;
26
- }
27
- /**
28
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per i Line Chart
29
- */
30
- adaptDataForPieChart(anyData) {
31
- return anyData;
32
- }
33
- /**
34
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per i Vertical Chart
35
- */
36
- adaptDataForVerticalChart(anyData) {
37
- return anyData;
38
- }
39
- /**
40
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per i Vertical Chart a due dimensioni
41
- */
42
- adaptDataForVertical2DChart(anyData) {
43
- return anyData;
44
- }
45
- /**
46
- * Trasformatore dai dati della libreria vecchia ai dati della libreria nuova per i Vertical Chart sovrapposti
47
- */
48
- adaptDataForVerticalStackedChart(anyData) {
49
- return anyData;
50
- }
51
- }
52
- BaseAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
53
- BaseAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseAdapter });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseAdapter, decorators: [{
55
- type: Injectable
56
- }] });
57
-
58
- /**
59
- * Dati relativi a un grafico di tipo LineChart
60
- */
61
- class LineChartData {
62
- /**
63
- * Costruttore
64
- *
65
- * @param {LineSerie[]} series Lista di serie da graficare
66
- * @param {{upper: lower}}
67
- */
68
- constructor(series = [], limit) {
69
- this.series = series;
70
- this.limit = limit;
71
- }
72
- }
73
-
74
- /**
75
- * Dati relativi a un grafico di tipo PieChart
76
- */
77
- class PieChartData {
78
- /**
79
- * Costruttore
80
- *
81
- * @param {KeyValueColor[]} values Lista di Chiave-Valore-Colore che rappresentano ognuno uno spicchio del grafico a torta
82
- */
83
- constructor(values = []) {
84
- this.values = values;
85
- }
86
- }
87
-
88
- /**
89
- * Dati relativi a un grafico di tipo AreaChart
90
- */
91
- class AreaChartData {
92
- /**
93
- * Costruttore
94
- *
95
- * @param {{ name: Date; values: KeyValue[]; }[]} groups Gruppi di valori raggruppati per data
96
- * @param {BaseInterval} interval Intervallo della serie. Viene utilizzato per gestire eventuali Gap
97
- */
98
- constructor(groups = [], interval) {
99
- this.groups = groups;
100
- this.interval = interval;
101
- }
102
- }
103
-
104
- /**
105
- * Dati relativi a un grafico di tipo Vertical2DChart
106
- */
107
- class Vertical2DChartData {
108
- /**
109
- * Costruttore
110
- *
111
- * @param {{ name: string; values: KeyValue[];, uom: string }[]} groups Gruppi di valori raggruppati per nome
112
- * @param {{ color: string }[]} colorinfos Lista dei colori da utilizzare. Vanno a sovrascrivere quelli di default di amcharts
113
- */
114
- constructor(groups = [], colorinfos) {
115
- this.groups = groups;
116
- this.colorinfos = colorinfos;
117
- }
118
- }
119
-
120
- /**
121
- * Dati relativi a un grafico di tipo VerticalChart
122
- */
123
- class VerticalChartData {
124
- /**
125
- * Costruttore
126
- *
127
- * @param {KeyValueColor[]} values Lista di Chiave-Valore-Colore che rappresentano ognuno una colonna
128
- */
129
- constructor(values = []) {
130
- this.values = values;
131
- }
132
- }
133
-
134
- /**
135
- * Dati relativi a un grafico di tipo VerticalStackedChart
136
- */
137
- class VerticalStackedChartData {
138
- /**
139
- * Costruttore
140
- *
141
- * @param {{ name: string; values: KeyValue[], uom: string }[]} groups Gruppi di valori raggruppati per nome
142
- */
143
- constructor(groups = []) {
144
- this.groups = groups;
145
- }
146
- }
147
-
148
- /**
149
- * Classe che racchiude le impostazioni base bene o male applicabili ad ogni Grafico
150
- */
151
- class BaseSettings {
152
- }
153
-
154
- /**
155
- * Classe che presenta le impostazioni di generazione per i grafici di tipo AreaChart
156
- */
157
- class AreaChartSettings extends BaseSettings {
158
- /**
159
- * @ignore
160
- */
161
- constructor() { super(); }
162
- }
163
-
164
- /**
165
- * Classe che presenta le impostazioni di generazione per i grafici di tipo LineChart
166
- */
167
- class LineChartSettings extends BaseSettings {
168
- /**
169
- * @ignore
170
- */
171
- constructor() { super(); }
172
- }
173
-
174
- /**
175
- * Classe che presenta le impostazioni di generazione per i grafici di tipo PieChart
176
- */
177
- class PieChartSettings extends BaseSettings {
178
- }
179
-
180
- /**
181
- * Classe che presenta le impostazioni di generazione per i grafici di tipo Vertical2DChart
182
- */
183
- class Vertical2DChartSettings extends BaseSettings {
184
- /**
185
- * @ignore
186
- */
187
- constructor() { super(); }
188
- }
189
-
190
- /**
191
- * Classe che presenta le impostazioni di generazione per i grafici di tipo VerticalChart
192
- */
193
- class VerticalChartSettings extends BaseSettings {
194
- /**
195
- * @ignore
196
- */
197
- constructor() { super(); }
198
- }
199
-
200
- /**
201
- * Classe che presenta le impostazioni di generazione per i grafici di tipo VerticalStackedChart
202
- */
203
- class VerticalStackedChartSettings extends BaseSettings {
204
- /**
205
- * @ignore
206
- */
207
- constructor() { super(); }
208
- }
209
-
210
- /**
211
- * Classe che identifica un intervallo di tempo fra un dato e l'altro
212
- */
213
- class BaseInterval {
214
- }
215
-
216
- /**
217
- * Classe che identifica le informazioni di Padding per la Legenda
218
- */
219
- class LegendPad {
220
- }
221
-
222
- /**
223
- * Modello che identifica un limite superiore - inferiore
224
- */
225
- class Limit {
226
- /** @ignore */
227
- constructor(upper, upperlabel, uppercolor, lower, lowerlabel, lowercolor, fillColor = "") {
228
- this.upper = upper;
229
- this.upperlabel = upperlabel;
230
- this.uppercolor = uppercolor;
231
- this.lower = lower;
232
- this.lowerlabel = lowerlabel;
233
- this.lowercolor = lowercolor;
234
- this.fillColor = fillColor;
235
- }
236
- }
237
-
238
- /**
239
- * Modello che identifica la coppia Data-Valore
240
- */
241
- class DateValue {
242
- /** @ignore */
243
- constructor(d, v) {
244
- this.d = d;
245
- this.v = v;
246
- }
247
- }
248
-
249
- /**
250
- * Modello che identifica la coppia Chiave-Valore
251
- */
252
- class KeyValue {
253
- /** @ignore */
254
- constructor(k, v) {
255
- this.k = k;
256
- this.v = v;
257
- }
258
- }
259
-
260
- /**
261
- * Modello che identifica la coppia Chiave-Valore con in aggiunta il Colore da usare per la serie che verrà creata da questo modello
262
- */
263
- class KeyValueColor {
264
- /** @ignore */
265
- constructor(k, v, c, t) {
266
- this.k = k;
267
- this.v = v;
268
- this.c = c;
269
- this.t = t;
270
- }
271
- }
272
-
273
- /**
274
- * Modello che identifica una serie a Linea
275
- */
276
- class LineSerie {
277
- /**
278
- * Costruttore
279
- *
280
- * @param {string} name Nome della serie
281
- * @param {DateValue[]} values Valori della serie
282
- * @param {BaseInterval} interval Intervallo della serie. Viene utilizzato per gestire Gap e date in Istante Finale
283
- * @param {string} color Colore della serie, verrà usato sia per la linea base che eventualmente per il riempimento (in caso si utilizzi l'Input **Fill** nel grafico)
284
- * @param {string} uom Unità di misura da presentare nell'asse delle Y
285
- * @param {boolean} fill Override della proprietà **Fill** del grafico, specifico per ogni serie
286
- * @param {boolean} stacked Override della proprietà **Stacked** del grafico, specifico per ogni serie
287
- * @param {boolean} hidden Indica se la serie deve partire nascosta di default
288
- */
289
- constructor(name, values, interval, color, uom, fill, stacked, hidden) {
290
- this.name = name;
291
- this.values = values;
292
- this.interval = interval;
293
- this.color = color;
294
- this.uom = uom;
295
- this.fill = fill;
296
- this.stacked = stacked;
297
- this.hidden = hidden;
298
- }
299
- }
300
-
301
- /**
302
- * Componente che si occupa della paginazione dei grafici qualora servisse
303
- */
304
- class PageChartSelector {
305
- constructor() {
306
- /**
307
- * Indica un cambio di pagina ed emette un oggetto con i dati attuali e l'indice attuale.
308
- *
309
- * Qualora la proprietà **data** fosse null indica un evento di "loading"
310
- */
311
- this.onPageChange = new EventEmitter();
312
- }
313
- /**
314
- * @ignore
315
- */
316
- ngOnChanges() {
317
- if (!(this.Items || this.Dtos) || (this.Items || this.Dtos).length == 0)
318
- throw new Error("Chart array cannot be empty!");
319
- var idx = (this.StartIndex || 0);
320
- this.currentindex = idx;
321
- this.currentpage = idx + 1;
322
- this.handlePageChange();
323
- }
324
- /**
325
- * Gestisce un cambio pagina inviando al callback **onPageChange** i dati attuali (siano essi il Dto per il caricamento dati i
326
- * o i dati già presenti) e l'indice di visualizzazione
327
- */
328
- handlePageChange() {
329
- this.finalIndex = this.currentpage - 1;
330
- this.currentindex = this.currentpage - 1;
331
- let data = this.Items && this.Items.length > 0 ? this.Items[this.finalIndex].data : this.Dtos[this.finalIndex];
332
- this.onPageChange.emit({ data: data, index: this.finalIndex });
333
- }
334
- /**
335
- * Visualizza il grafico successivo
336
- */
337
- Next() {
338
- // Per passare da page a index è sempre un -1
339
- this.currentpage++;
340
- this.onPageChange.emit({ data: null, index: this.currentpage - 1 });
341
- // Delay pseudo-intelligente per click compulsivi.
342
- // Se dopo questo delay sono andato avanti solo di 1 effettuo il callback altrimenti incremento l'indice
343
- setTimeout(() => {
344
- if (this.currentindex == this.currentpage - 2)
345
- this.handlePageChange();
346
- else
347
- this.currentindex++;
348
- }, this.BrowseDelayMs);
349
- }
350
- /**
351
- * Visualizza il grafico precedente
352
- */
353
- Previous() {
354
- // Per passare da page a index è sempre un -1
355
- this.currentpage--;
356
- this.onPageChange.emit({ data: null, index: this.currentpage - 1 });
357
- // Delay pseudo-intelligente per click compulsivi.
358
- // Se dopo questo delay sono andato indietro solo di 1 effettuo il callback altrimenti decremento l'indice
359
- setTimeout(() => {
360
- if (this.currentindex == this.currentpage)
361
- this.handlePageChange();
362
- else
363
- this.currentindex--;
364
- }, this.BrowseDelayMs);
365
- }
366
- }
367
- PageChartSelector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageChartSelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
368
- PageChartSelector.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PageChartSelector, selector: "chart-pager", inputs: { Items: "Items", Dtos: "Dtos", BrowseDelayMs: "BrowseDelayMs", StartIndex: "StartIndex" }, outputs: { onPageChange: "onPageChange" }, queries: [{ propertyName: "headerInner_tr", first: true, predicate: ["header_inner"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"(Items || Dtos) && (Items || Dtos).length > 0\" class=\"pcs-no-selection\">\r\n <div class=\"pcs-button pcs-backward\">\r\n <svg class=\"pcs-svg-header\">\r\n <g class=\"pcs-svg-button-container\" role=\"button\" (click)=\"currentpage != 1 && Previous(); $event.stopPropagation(); $event.preventDefault();\">\r\n <!--Pulsante e freccettina all'interno-->\r\n <g class=\"pcs-svg-button\" [style.cursor]=\"currentpage == 1 ? 'not-allowed' : 'pointer'\"><path d=\"M3,0 L53.027,0 a3,3 0 0 1 3,3 L56.027,36.817 a3,3 0 0 1 -3,3 L3,39.817 a3,3 0 0 1 -3,-3 L0,3 a3,3 0 0 1 3,-3 Z\"></path></g>\r\n <g class=\"pcs-svg-arrow pcs-svg-arrow-left\"><path d=\"M26,14H10l5.17-6.79A2,2,0,0,0,12,4.79l-7.62,10a2,2,0,0,0,0,2.42l7.62,10a2,2,0,0,0,3.18-2.42L10,18H26a2,2,0,0,0,0-4Z\"></path></g>\r\n </g>\r\n </svg>\r\n </div>\r\n <div class=\"pcs-infos\">\r\n <ng-container *ngIf=\"headerInner_tr\">\r\n <ng-container *ngTemplateOutlet=\"headerInner_tr; context : {$implicit: (Items || Dtos)[currentpage - 1]}\"></ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"pcs-button pcs-forward\">\r\n <svg class=\"pcs-svg-header\">\r\n <g class=\"pcs-svg-button-container\" role=\"button\" (click)=\"(Items || Dtos).length != currentpage && Next(); $event.stopPropagation(); $event.preventDefault();\">\r\n <!--Pulsante e freccettina all'interno-->\r\n <g class=\"pcs-svg-button\" [style.cursor]=\"(Items || Dtos).length == currentpage ? 'not-allowed' : 'pointer'\"><path d=\"M3,0 L53.027,0 a3,3 0 0 1 3,3 L56.027,36.817 a3,3 0 0 1 -3,3 L3,39.817 a3,3 0 0 1 -3,-3 L0,3 a3,3 0 0 1 3,-3 Z\"></path></g>\r\n <g class=\"pcs-svg-arrow pcs-svg-arrow-right\"><path d=\"M26,14H10l5.17-6.79A2,2,0,0,0,12,4.79l-7.62,10a2,2,0,0,0,0,2.42l7.62,10a2,2,0,0,0,3.18-2.42L10,18H26a2,2,0,0,0,0-4Z\"></path></g>\r\n </g>\r\n </svg>\r\n </div>\r\n <div style=\"clear: both;\"></div>\r\n</div>", styles: [".pcs-button{width:60px}.pcs-forward{float:right;text-align:end}.pcs-backward{float:left}.pcs-svg-header{width:57px;height:40px}.pcs-svg-button-container{outline:currentcolor none medium}.pcs-svg-arrow{pointer-events:none;fill:#555}.pcs-svg-arrow-right{transform:translate(44px,36px) rotate(180deg)}.pcs-svg-arrow-left{transform:translate(13px,4px)}.pcs-svg-button{fill:#d9d9d9;stroke:#fff;fill-opacity:1;stroke-opacity:1}.pcs-svg-button:hover{fill:#a3a3a3;cursor:pointer}.pcs-infos{width:calc(100% - 120px);height:44px;float:left}.pcs-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageChartSelector, decorators: [{
370
- type: Component,
371
- args: [{ selector: "chart-pager", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"(Items || Dtos) && (Items || Dtos).length > 0\" class=\"pcs-no-selection\">\r\n <div class=\"pcs-button pcs-backward\">\r\n <svg class=\"pcs-svg-header\">\r\n <g class=\"pcs-svg-button-container\" role=\"button\" (click)=\"currentpage != 1 && Previous(); $event.stopPropagation(); $event.preventDefault();\">\r\n <!--Pulsante e freccettina all'interno-->\r\n <g class=\"pcs-svg-button\" [style.cursor]=\"currentpage == 1 ? 'not-allowed' : 'pointer'\"><path d=\"M3,0 L53.027,0 a3,3 0 0 1 3,3 L56.027,36.817 a3,3 0 0 1 -3,3 L3,39.817 a3,3 0 0 1 -3,-3 L0,3 a3,3 0 0 1 3,-3 Z\"></path></g>\r\n <g class=\"pcs-svg-arrow pcs-svg-arrow-left\"><path d=\"M26,14H10l5.17-6.79A2,2,0,0,0,12,4.79l-7.62,10a2,2,0,0,0,0,2.42l7.62,10a2,2,0,0,0,3.18-2.42L10,18H26a2,2,0,0,0,0-4Z\"></path></g>\r\n </g>\r\n </svg>\r\n </div>\r\n <div class=\"pcs-infos\">\r\n <ng-container *ngIf=\"headerInner_tr\">\r\n <ng-container *ngTemplateOutlet=\"headerInner_tr; context : {$implicit: (Items || Dtos)[currentpage - 1]}\"></ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"pcs-button pcs-forward\">\r\n <svg class=\"pcs-svg-header\">\r\n <g class=\"pcs-svg-button-container\" role=\"button\" (click)=\"(Items || Dtos).length != currentpage && Next(); $event.stopPropagation(); $event.preventDefault();\">\r\n <!--Pulsante e freccettina all'interno-->\r\n <g class=\"pcs-svg-button\" [style.cursor]=\"(Items || Dtos).length == currentpage ? 'not-allowed' : 'pointer'\"><path d=\"M3,0 L53.027,0 a3,3 0 0 1 3,3 L56.027,36.817 a3,3 0 0 1 -3,3 L3,39.817 a3,3 0 0 1 -3,-3 L0,3 a3,3 0 0 1 3,-3 Z\"></path></g>\r\n <g class=\"pcs-svg-arrow pcs-svg-arrow-right\"><path d=\"M26,14H10l5.17-6.79A2,2,0,0,0,12,4.79l-7.62,10a2,2,0,0,0,0,2.42l7.62,10a2,2,0,0,0,3.18-2.42L10,18H26a2,2,0,0,0,0-4Z\"></path></g>\r\n </g>\r\n </svg>\r\n </div>\r\n <div style=\"clear: both;\"></div>\r\n</div>", styles: [".pcs-button{width:60px}.pcs-forward{float:right;text-align:end}.pcs-backward{float:left}.pcs-svg-header{width:57px;height:40px}.pcs-svg-button-container{outline:currentcolor none medium}.pcs-svg-arrow{pointer-events:none;fill:#555}.pcs-svg-arrow-right{transform:translate(44px,36px) rotate(180deg)}.pcs-svg-arrow-left{transform:translate(13px,4px)}.pcs-svg-button{fill:#d9d9d9;stroke:#fff;fill-opacity:1;stroke-opacity:1}.pcs-svg-button:hover{fill:#a3a3a3;cursor:pointer}.pcs-infos{width:calc(100% - 120px);height:44px;float:left}.pcs-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}\n"] }]
372
- }], propDecorators: { Items: [{
373
- type: Input
374
- }], Dtos: [{
375
- type: Input
376
- }], BrowseDelayMs: [{
377
- type: Input
378
- }], StartIndex: [{
379
- type: Input
380
- }], onPageChange: [{
381
- type: Output
382
- }], headerInner_tr: [{
383
- type: ContentChild,
384
- args: ['header_inner', { static: false }]
385
- }] } });
386
-
387
- /** @ignore */
388
- const _spiritedaway = 'spiritedaway';
389
- /** @ignore */
390
- const _moonrisekingdom = 'moonrisekingdom';
391
- /** @ignore */
392
- const _frozen = 'frozen';
393
- /** @ignore */
394
- const _dark = 'dark';
395
- /** @ignore */
396
- const _kelly = 'kelly';
397
- /** @ignore */
398
- const _material = 'material';
399
- /** @ignore */
400
- const _dataviz = 'dataviz';
401
- /** @ignore */
402
- const _none = 'none';
403
- /** @ignore */
404
- const _animated = 'animated';
405
- /**
406
- * Classe per enumerare i temi disponibili nella libreria
407
- */
408
- // @dynamic
409
- class ChartThemes {
410
- get spiritedaway() { return _spiritedaway; }
411
- ;
412
- get moonrisekingdom() { return _moonrisekingdom; }
413
- ;
414
- get frozen() { return _frozen; }
415
- ;
416
- get dark() { return _dark; }
417
- ;
418
- get kelly() { return _kelly; }
419
- ;
420
- get material() { return _material; }
421
- ;
422
- get dataviz() { return _dataviz; }
423
- ;
424
- get none() { return _none; }
425
- ;
426
- get animated() { return _animated; }
427
- ;
428
- static get spiritedaway() { return _spiritedaway; }
429
- ;
430
- static get moonrisekingdom() { return _moonrisekingdom; }
431
- ;
432
- static get frozen() { return _frozen; }
433
- ;
434
- static get dark() { return _dark; }
435
- ;
436
- static get kelly() { return _kelly; }
437
- ;
438
- static get material() { return _material; }
439
- ;
440
- static get dataviz() { return _dataviz; }
441
- ;
442
- static get none() { return _none; }
443
- ;
444
- static get animated() { return _animated; }
445
- ;
446
- }
447
-
448
- /**
449
- * 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)
450
- */
451
- const ESC_ANIMATIONS = new InjectionToken('ESC_ANIMATIONS');
452
- /**
453
- * Token che identifica il Tema di default per tutti i grafici, può essere sovrascritto dalle impostazioni locali (Settings e Input)
454
- */
455
- const ESC_THEME = new InjectionToken('ESC_THEME');
456
- /**
457
- * Token che identifica l'utilizzo o meno del sistema di Log per l'intera libreria
458
- */
459
- const ESC_DEBUG_MODE = new InjectionToken('ESC_DEBUG_MODE');
460
-
461
- /**
462
- * Classe di supporto al caricamento dinamico dei vari pezzi di amcharts che mi servono per il grafico (temi, locali, ecc...)
463
- *
464
- * Essenzialmente ogni volta che viene creato un grafico, questo acquisisce il tema e il locale applicato IN QUEL MOMENTO,
465
- * questo significa che per creare due grafici con temi diversi bisogna fare:
466
- *
467
- * 1) Caricamento tema 1
468
- *
469
- * 2) Creazione grafico 1
470
- *
471
- * 3) Scaricamento tema 1
472
- *
473
- * 3) Caricamento tema 2
474
- *
475
- * 4) Creazione grafico 2
476
- *
477
- */
478
- class ChartLoader {
479
- /**
480
- * @ignore
481
- */
482
- constructor(logs) {
483
- this.logs = logs;
484
- /**
485
- * Indica se attualmente ho le animazioni caricate in modo da non ricaricarle inutilmente
486
- */
487
- this.AnimationsAreLoaded = false;
488
- /**
489
- * Indica l'ultimo tema caricato in modo da non ricaricarlo inutilmente qualora il prossimo grafico da creare richieda lo stesso tema
490
- */
491
- this.LastLoadedTheme = "";
492
- /**
493
- * Cache dei temi (moduli caricati dinamicamente)
494
- */
495
- this.themeCache = {};
496
- /**
497
- * Cache delle localizzazioni (moduli caricati dinamicamente)
498
- */
499
- this.localizationCache = {};
500
- }
501
- /**
502
- * Applica il tema con le animazioni all'istanza globale di amCharts
503
- *
504
- * @param {Object} chartsCore Istanza globale di amCharts
505
- * @returns {Promise} Promise che identifica la fine del caricamento
506
- */
507
- applyAnimations(chartsCore) {
508
- if (!this.AnimationsAreLoaded) {
509
- return this.importIfNeeded('themes', ChartThemes.animated).then(() => {
510
- this.log("CORE: Applying theme " + ChartThemes.animated);
511
- chartsCore.useTheme(this.themeCache[ChartThemes.animated]);
512
- this.AnimationsAreLoaded = true;
513
- });
514
- }
515
- else {
516
- this.log("CORE: theme already applyed " + ChartThemes.animated);
517
- return new Promise((resolve) => { resolve(true); });
518
- }
519
- }
520
- /**
521
- * De-applica il tema con le animazioni dall'istanza globale di amCharts
522
- *
523
- * @param {Object} chartsCore Istanza globale di amCharts
524
- * @returns {Promise} Promise che identifica la fine dello scarico
525
- */
526
- unapplyAnimations(chartsCore) {
527
- if (this.AnimationsAreLoaded) {
528
- this.log("CORE: Animations in use, unapplying theme " + ChartThemes.animated);
529
- chartsCore.unuseTheme(this.themeCache[ChartThemes.animated]);
530
- this.AnimationsAreLoaded = false;
531
- }
532
- else
533
- this.log("CORE: Animations already unused, no need to unapply them");
534
- return new Promise((resolve) => { resolve(true); });
535
- }
536
- /**
537
- * Applica il tema specificato all'istanza globale di amCharts
538
- *
539
- * @param {Object} chartsCore Istanza globale di amCharts
540
- * @param {'spiritedaway' | 'moonrisekingdom' | 'frozen' | 'dark' | 'kelly' | 'material' | 'dataviz' | 'none'} theme Tema da applicare
541
- * @returns {Promise} Promise che identifica la fine del caricamento
542
- */
543
- applyTheme(chartsCore, theme) {
544
- // Ultimo tema applicato è lo stesso che mi è stato richiesto di applicare --> NO-OP
545
- if (this.LastLoadedTheme == theme) {
546
- this.log("CORE: theme already applied " + theme);
547
- return new Promise((resolve) => { resolve(true); });
548
- }
549
- // Scarico il tema precedente a prescindere, ormai non mi serve più
550
- this.unapplyPreviousTheme(chartsCore);
551
- // Il tema è il none --> registro la cosa e basta, il tema precedente è stato rimosso subito qui sopra ^
552
- if (theme == ChartThemes.none) {
553
- this.LastLoadedTheme = ChartThemes.none;
554
- return new Promise((resolve) => { resolve(true); });
555
- }
556
- // Il tema è diverso dal precedente e non è il tema vuoto --> Importo il tema specificato se non presente in memoria e lo applico al grafico attuale
557
- return this.importIfNeeded('themes', theme).then(() => {
558
- this.log("CORE: Applying theme " + theme);
559
- chartsCore.useTheme(this.themeCache[theme]);
560
- this.LastLoadedTheme = theme;
561
- });
562
- }
563
- /**
564
- * De-applica il tema precedente dall'istanza globale di amCharts
565
- *
566
- * @param {Object} chartsCore Istanza globale di amCharts
567
- */
568
- unapplyPreviousTheme(chartsCore) {
569
- if (!this.LastLoadedTheme || this.LastLoadedTheme == ChartThemes.none)
570
- return;
571
- this.log("CORE: Unapplying previously used theme " + this.LastLoadedTheme);
572
- chartsCore.unuseTheme(this.themeCache[this.LastLoadedTheme]);
573
- }
574
- /**
575
- * Applica il locale specificato all'istanza specifica del grafico
576
- *
577
- * @param {amCharts.Chart} chart Istanza specifica del grafico a cui applicare il locale
578
- * @param {string} locale Locale da applicare
579
- * @returns {Promise} Promise che identifica la fine del caricamento
580
- */
581
- applyLocale(chart, locale) {
582
- return this.importIfNeeded('lang', locale).then(() => {
583
- this.log("Chart " + chart.htmlContainer.id + ": applying locale " + locale);
584
- chart.language.locale = this.localizationCache[locale];
585
- });
586
- }
587
- /**
588
- * Permette di importare, se serve un dato tema o localizzazione
589
- *
590
- * @param {'lang' | 'themes'} what Oggetto da importare, se localizzazione o tema
591
- * @param {string} item Chiave dell'oggetto da importare
592
- *
593
- * @returns {Promise} Promise che identifica la fine del caricamento
594
- */
595
- importIfNeeded(what, item) {
596
- // Se sto cercando di caricare qualcosa di già caricato non faccio nulla
597
- if (!(what == 'themes' && !this.themeCache[item]) && !(what == 'lang' && !this.localizationCache[item])) {
598
- this.log("CORE: " + (what == 'lang' ? "Language " : "Theme ") + item + " already loaded");
599
- return new Promise((resolve) => { resolve(true); });
600
- }
601
- this.log("CORE: Loading " + (what == 'lang' ? "language " : "theme ") + item);
602
- /*
603
- * ****************************
604
- * ******** ATTENZIONE ********
605
- * ****************************
606
- *
607
- * Se stai vedendo questo codice di import e stai valutando di riscriverlo come:
608
- *
609
- * V V
610
- * import(`@amcharts/amcharts4/${what}/${item}`).then(module => {
611
- * if (what == 'themes') this.themeCache[item] = module.default;
612
- * else if (what == 'lang') this.localizationCache[item] = module.default;
613
- * });
614
- *
615
- * Sappi che è una pessima idea. Gli import sono valutati da webpack in compiletime per generare i chunk,
616
- * mettere la navigazione agli import con la concatenazione viene preso malissimo ed essenzialmente dice a webpack
617
- * di tirare su e bundlare l'intera node_modules. Divertente, no?
618
- *
619
- */
620
- switch (what) {
621
- case 'themes':
622
- switch (item) {
623
- case ChartThemes.spiritedaway:
624
- return import('@amcharts/amcharts4/themes/spiritedaway').then(theme => this.themeCache[item] = theme.default);
625
- case ChartThemes.moonrisekingdom:
626
- return import('@amcharts/amcharts4/themes/moonrisekingdom').then(theme => this.themeCache[item] = theme.default);
627
- case ChartThemes.frozen:
628
- return import('@amcharts/amcharts4/themes/frozen').then(theme => this.themeCache[item] = theme.default);
629
- case ChartThemes.dark:
630
- return import('@amcharts/amcharts4/themes/dark').then(theme => this.themeCache[item] = theme.default);
631
- case ChartThemes.kelly:
632
- return import('@amcharts/amcharts4/themes/kelly').then(theme => this.themeCache[item] = theme.default);
633
- case ChartThemes.material:
634
- return import('@amcharts/amcharts4/themes/material').then(theme => this.themeCache[item] = theme.default);
635
- case ChartThemes.dataviz:
636
- return import('@amcharts/amcharts4/themes/dataviz').then(theme => this.themeCache[item] = theme.default);
637
- case ChartThemes.animated:
638
- return import('@amcharts/amcharts4/themes/animated').then(theme => this.themeCache[item] = theme.default);
639
- }
640
- break;
641
- case 'lang':
642
- switch (item) {
643
- case 'it-IT':
644
- return import('@amcharts/amcharts4/lang/it_IT').then(lang => this.localizationCache[item] = lang.default);
645
- case 'en-US':
646
- return import('@amcharts/amcharts4/lang/en_US').then(lang => this.localizationCache[item] = lang.default);
647
- }
648
- }
649
- this.log("CORE: Loading Failed. " + (what == 'lang' ? "Language " : "Theme") + " not recognized: " + item);
650
- return new Promise((resolve) => { resolve(true); });
651
- }
652
- /**
653
- * @ignore
654
- */
655
- log(text) {
656
- if (this.logs)
657
- console.log("@esfaenza/es-charts: " + text);
658
- }
659
- }
660
- ChartLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartLoader, deps: [{ token: ESC_DEBUG_MODE }], target: i0.ɵɵFactoryTarget.Injectable });
661
- ChartLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartLoader });
662
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartLoader, decorators: [{
663
- type: Injectable
664
- }], ctorParameters: function () {
665
- return [{ type: undefined, decorators: [{
666
- type: Inject,
667
- args: [ESC_DEBUG_MODE]
668
- }] }];
669
- } });
670
-
671
- /**
672
- * 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
673
- */
674
- class ChartDispatcher {
675
- /**
676
- * @ignore
677
- */
678
- constructor(logs) {
679
- this.logs = logs;
680
- /**
681
- * Coda di inizializzazioni ancora da eseguire. Quando questa è vuota significa che nessuno sta creando grafici
682
- */
683
- this.Initializations = [];
684
- /**
685
- * Lista dei grafici inizializzati e attivi in un dato momento (viene registrata la proprietà **name**). Non è possibile registrare due grafici con lo stesso identificativo
686
- */
687
- this.InitializedGraphs = [];
688
- }
689
- /**
690
- * Registra un grafico da visualizzare insieme alla propria funzione di creazione. Quest'ultima sarà differita fino a che tutti i grafici
691
- * precedentemente registati non hanno finito la fase di inizializzazione
692
- *
693
- * @param {string} name Identificativo del grafico da registrare
694
- * @param {Function} chartCreationFunction Funzione che fisicamente dovrà occuparsi della creazione del grafico
695
- */
696
- register(name, chartCreationFunction) {
697
- if (this.InitializedGraphs.indexOf(name) != -1)
698
- throw "Attempting to register a duplicate chart '" + name + "'. Make sure the 'name' properties of your charts are univoque";
699
- this.log("DISPATCHER: Registering chart creation function execution for " + name);
700
- this.Initializations.push({ name: name, function: chartCreationFunction });
701
- if (this.Initializations.length == 1) {
702
- this.log("DISPATCHER: Initial drain started");
703
- this.drainInitQueues();
704
- }
705
- }
706
- /**
707
- * Deregistra un grafico presente. Chiamata generalmente al dispose del grafico in questione quando non dev'essere più mostrato nella pagina corrente
708
- *
709
- * @param {string} name Identificativo del grafico da deregistrare
710
- */
711
- deregisterGraph(name) {
712
- let index = this.InitializedGraphs.indexOf(name);
713
- if (index == -1) {
714
- //Questo succede quando si cerca di distruggere il grafico mentre sta venendo graficato
715
- this.log("DISPATCHER: Registration missing for chart " + name + " it was probably destroyed during load");
716
- return;
717
- }
718
- this.log("DISPATCHER: Chart deregistered " + name);
719
- this.InitializedGraphs.splice(index, 1);
720
- }
721
- /**
722
- * Metodo che esegue in maniera sequenziale le funzioni di inizializzazione dei grafici finché presenti
723
- * in modo che nessun grafico possa essere inizializzato contemporaneamente ad un altro.
724
- *
725
- * Questo è il punto chiave che permette di avere per ogni grafico temi e locale differenti
726
- */
727
- drainInitQueues() {
728
- let toExecute = this.Initializations[0];
729
- this.log("DISPATCHER: Executing initialization function for chart " + toExecute.name);
730
- toExecute.function().then(() => {
731
- this.log("DISPATCHER: initialization for chart " + toExecute.name + " is done");
732
- this.InitializedGraphs.push(toExecute.name);
733
- this.Initializations.splice(0, 1);
734
- if (this.Initializations.length >= 1) {
735
- this.log("DISPATCHER: Found queued initializations. Continuing");
736
- this.drainInitQueues();
737
- }
738
- else
739
- this.log("DISPATCHER: queue is over, nothing more to do");
740
- });
741
- }
742
- /**
743
- * @ignore
744
- */
745
- log(text) {
746
- if (this.logs)
747
- console.log("@esfaenza/es-charts: " + text);
748
- }
749
- }
750
- ChartDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartDispatcher, deps: [{ token: ESC_DEBUG_MODE }], target: i0.ɵɵFactoryTarget.Injectable });
751
- ChartDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartDispatcher });
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ChartDispatcher, decorators: [{
753
- type: Injectable
754
- }], ctorParameters: function () {
755
- return [{ type: undefined, decorators: [{
756
- type: Inject,
757
- args: [ESC_DEBUG_MODE]
758
- }] }];
759
- } });
760
-
761
- /**
762
- * Componente Grafico Base che gestisce tutte le cose comuni dei vari grafici istanziabili, come la presenza o menu di una legenda,
763
- * il tema utilizzato, il locale del singolo grafico, ecc ecc...
764
- */
765
- class BaseChartComponent {
766
- /**
767
- * Costruttore
768
- *
769
- * @param {ElementRef} el Contenitore all'interno del cui viene creato il grafico. Utilizzato per estrapolarne la **ContainerHeight**
770
- * @param {Object} platformId piattaforma Angular (browser, ecc...) per essere sicuri che amcharts venga attivato solo lato browser. Non utilizzando SSR nelle applicazioni che consumano questa libreria non è particolarmente significativo, ma non si sa mai
771
- * @param {NgZone} zone NgZone di default per permettere di inizializzare il grafico all'infuori di Angular per avere qualche prestazione in più
772
- * @param {ChartLoader} Charter Istanza del Loader che si occuperà di caricare in memoria tutto ciò che serve per il grafico attuale (temi, locale, animazioni, ecc...)
773
- * @param {ChartDispatcher} Dispatcher Istanza del Dispatcher che si occupa di differire il caricamento dei grafici 1 dopo l'altro in modo che caricamenti pseudo paralleli incasinino tutto
774
- * @param {boolean} logs Indica se effettuare log a console o meno, iniettato dalle classi specializzate dal token ESC_DEBUG_MODE
775
- * @param {boolean} animations Indica se per questo grafico devono essere attive o meno le animazioni. Impostazione generica presa dal token ESC_ANIMATIONS
776
- * @param {string} locale Indica il locale specifico per questo grafico. Impostazione generica presa dal LocalizationService
777
- * @param {string} theme Indica il tema specifico per questo grafico. Impostazione generica presa dal token ESC_THEME
778
- */
779
- constructor(el, platformId, zone, Charter, Dispatcher, logs, animations, locale, theme) {
780
- this.el = el;
781
- this.platformId = platformId;
782
- this.zone = zone;
783
- this.Charter = Charter;
784
- this.Dispatcher = Dispatcher;
785
- this.logs = logs;
786
- this.animations = animations;
787
- this.locale = locale;
788
- this.theme = theme;
789
- /**
790
- * Nome del grafico, fondamentale assegnarlo per permettere alla libreria di schedularne la creazione
791
- */
792
- this.name = "";
793
- /**
794
- * Dopo aver navigato a un nuovo grafico verranno attesi questi millisecondi prima di richiedere i dati attraverso la **DataRetrieve**.
795
- *
796
- * Questo per evitare che l'utente cliccando velocemente "avanti" generi tonnellate di richieste inutili
797
- */
798
- this.BrowseDelayMs = 500;
799
- /**
800
- * Evento lanciato sulla selezione di un range di dati o dalla timeline o dal grafico. Valido per tutti i grafici che supportano serie basate sulle date
801
- */
802
- this.onSelectionChanged = new EventEmitter();
803
- /**
804
- * Evento lanciato dal click di una serie dalla Legenda, a patto che l'Input **HideSeriesOnLabelClick** sia impostato a false
805
- */
806
- this.onSeriesClicked = new EventEmitter();
807
- /**
808
- * Evento lanciato all'inizio del caricamento di una nuova pagina del grafico
809
- */
810
- this.onLoadStart = new EventEmitter();
811
- /**
812
- * Evento lanciato al termine del caricamento di una nuova pagina del grafico
813
- */
814
- this.onLoadEnd = new EventEmitter();
815
- /**
816
- * Evento lanciato al termine della creazione del grafico referenziando l'istanza nativa del grafico creato in modo da poter effettuare modifiche
817
- * post inizializzazione lato applicativo
818
- */
819
- this.chartLoaded = new EventEmitter();
820
- /**
821
- * Serve a decidere se sarà presente l'interfaccia di paginazione
822
- */
823
- this.isPaged = false;
824
- /**
825
- * @ignore
826
- */
827
- this.initDone = false;
828
- }
829
- /**
830
- * Metodo di inizializzazione post valorizzazione degli input, utilizzato per valorizzare correttamente le proprietà essenziali del grafico (Animazioni, Tema e Locale)
831
- *
832
- * Viene data priorità ai Settings (HTML), priorità secondaria agli Input diretti (Lato HTML), priorità ultima alle impostazioni globali,
833
- * impostate in fase di import del modulo assegnando valori ai token ESC_ANIMATIONS, ESC_THEME
834
- */
835
- ngOnInit() {
836
- var _a, _b, _c, _d, _e, _f;
837
- // Qui servono solo le variabili da conoscere PRE-graficazione per il caricamento dei moduli lazy del grafico
838
- this.Animations = ((_a = this.Settings) === null || _a === void 0 ? void 0 : _a.Animations) != null ? (_b = this.Settings) === null || _b === void 0 ? void 0 : _b.Animations : (this.Animations != null ? this.Animations : this.animations);
839
- this.Theme = ((_c = this.Settings) === null || _c === void 0 ? void 0 : _c.Theme) != null ? (_d = this.Settings) === null || _d === void 0 ? void 0 : _d.Theme : (this.Theme != null ? this.Theme : this.theme);
840
- this.Locale = ((_e = this.Settings) === null || _e === void 0 ? void 0 : _e.Locale) != null ? (_f = this.Settings) === null || _f === void 0 ? void 0 : _f.Locale : (this.Locale != null ? this.Locale : this.locale);
841
- this.isPaged = (this.DataArray && this.DataArray.length > 0 && !this.Data) || (this.DataDtos && this.DataDtos.length > 0 && !!this.DataRetrieve);
842
- this.log("Chart " + this.name + ": ngOnInit");
843
- }
844
- /**
845
- * Implementazione utilizzata per controllare eventuali proprietà chiave del grafico e rigraficare tutto qualora si rivelasse necessario
846
- *
847
- * @param {SimpleChanges} changes Indicazione dei cambiamenti sulle proprietà del grafico. Vedere documentazione Angular in merito
848
- */
849
- ngOnChanges(changes) {
850
- if (!this.initDone)
851
- return;
852
- this.log("Chart " + this.name + ": ngOnChanges");
853
- let propsToCheck = ["Timeline", "Legend", "Settings", "Animations", "Theme", "Locale", ...this.getSpecificPropertiesToCheck()];
854
- this.checkPropertiesAndRegraphicateAsNeeded(changes, propsToCheck);
855
- }
856
- /**
857
- * Nel post inizializzazione, a patto che mi trovi in ambiente "browser", proseguo al caricamento del grafico sull'HTML
858
- */
859
- ngAfterViewInit() {
860
- if (!this.name)
861
- throw "a Unique name is mandatory to create a chart";
862
- this.log("Chart " + this.name + ": ngAfterViewInit, graphicating chart outside Angular");
863
- if (!this.isPaged)
864
- this.dispatchLoadChart();
865
- }
866
- /**
867
- * All'onDestroy scarico il grafico per liberare memoria
868
- */
869
- ngOnDestroy() {
870
- if (this.Chart) {
871
- this.log("Chart " + this.name + ": Unloading destroyed chart");
872
- this.browserOnly(() => { this.Chart.dispose(); this.Dispatcher.deregisterGraph(this.name); });
873
- }
874
- else
875
- this.log("Chart " + this.name + ": Unloading uncreated chart component. It probably was a duplicated");
876
- }
877
- /**
878
- * Registra il grafico attuale nel Dispatcher in modo che venga caricato appena possibile
879
- */
880
- dispatchLoadChart() {
881
- this.browserOnly(() => {
882
- this.Dispatcher.register(this.name, () => { return this.loadChart(); });
883
- });
884
- }
885
- /**
886
- * Il caricamento del grafico funziona nel seguente modo:
887
- *
888
- * 1) Caricamento del tema e delle animazioni, qualora necessari
889
- *
890
- * 2) Caricamento delle impostazioni specifiche e integrazione con le impostazioni generiche
891
- *
892
- * 3) Graficazione
893
- *
894
- * 4) Caricamento del locale
895
- */
896
- loadChart() {
897
- this.log("Chart " + this.name + ": Start loading Modules if needed");
898
- return Promise.all([
899
- this.setupAmChartsThemes().then(() => {
900
- this.log("Chart " + this.name + ": Graphicating after modules load");
901
- var castedSettings = this.getCastedSettings();
902
- this.fillSettings(castedSettings);
903
- this.fillSpecificSettings(castedSettings);
904
- this.ChartService = this.graphicate(castedSettings);
905
- this.Chart = this.ChartService.ChartInstance;
906
- if (!this.Chart)
907
- this.log("Chart " + this.name + ": Could not create graph");
908
- // Unico punto reale in cui viene utilizzato il locale, tehe
909
- return this.Charter.applyLocale(this.Chart, this.Locale).then(() => { this.initDone = true; this.chartLoaded.emit(this); });
910
- })
911
- ]);
912
- }
913
- /**
914
- * Riempimento delle impostazioni nella classe Settings. Si danno priorità ai valori già impostati nei Settings,
915
- * integrando eventualmente con le proprietà del grafico
916
- *
917
- * @param {BaseSettings} settings Impostazioni base ricevute dalla specializzazione del grafico
918
- */
919
- fillSettings(settings) {
920
- var _a;
921
- // Merge degli Input con i Settings, dando priorità ai Settings
922
- settings.Theme = settings.Theme ? settings.Theme : this.Theme;
923
- settings.Locale = settings.Locale ? settings.Locale : this.Locale;
924
- settings.Animations = settings.Animations != null ? settings.Animations : this.Animations;
925
- settings.Legend = settings.Legend != null ? settings.Legend : this.Legend;
926
- settings.Name = settings.Name ? settings.Name : this.name;
927
- settings.Timeline = settings.Timeline != null ? settings.Timeline : this.Timeline;
928
- settings.AdaptLabelSizeAndOrientation = settings.AdaptLabelSizeAndOrientation != null ? settings.AdaptLabelSizeAndOrientation : this.AdaptLabelSizeAndOrientation;
929
- settings.XAxisTitle = settings.XAxisTitle ? settings.XAxisTitle : this.XTitle;
930
- settings.YAxisTitle = settings.YAxisTitle ? settings.YAxisTitle : this.YTitle;
931
- settings.LegendPosition = settings.LegendPosition ? settings.LegendPosition : this.LegendPosition;
932
- settings.HideSeriesOnLabelClick = settings.HideSeriesOnLabelClick != null ? settings.HideSeriesOnLabelClick : this.HideSeriesOnLabelClick;
933
- settings.MinGridDistance = settings.MinGridDistance != null ? settings.MinGridDistance : this.MinGridDistance;
934
- settings.LegendPadding = settings.LegendPadding ? settings.LegendPadding : (_a = this.LegendPadding) !== null && _a !== void 0 ? _a : null;
935
- settings.ContainerHeight = this.el.nativeElement.parentElement.offsetHeight;
936
- settings.OnSeriesClickCallback = (series) => { this.onSeriesClicked.emit(series); };
937
- settings.OnSelectionChangedCallback = (event) => { this.onSelectionChanged.emit({ from: event.from, to: event.to, initial: event.initial }); };
938
- }
939
- /**
940
- * Controlla i cambiamenti avvenuti alle proprietà chiave e rieffettua la graficazione qualora necessario
941
- *
942
- * @param {SimpleChanges} changes Indicazione della modifiche avvenute nei vari Input
943
- * @param {string[]} propsToCheck Lista degli Input da controllare per cui una modifica causa una rigraficazione
944
- */
945
- checkPropertiesAndRegraphicateAsNeeded(changes, propsToCheck) {
946
- let toReGraphicate = false;
947
- for (let i = 0; i < propsToCheck.length; i++)
948
- toReGraphicate = toReGraphicate || (changes[propsToCheck[i]] && changes[propsToCheck[i]].currentValue);
949
- if (toReGraphicate)
950
- this.reloadChart();
951
- }
952
- /**
953
- * Funzione che effettua un cambio di pagina per i grafici paginati. Qualora **data** fosse nullo significa che è iniziato un caricamento
954
- * e anche lato applicativo il DataRetrieve dovrà considerare che l'assenza di valori non è altro che un'indicazione di inizio caricamento
955
- *
956
- * Il caricamento di qualsiasi pagina genererà comunque una primo evento con **data** nullo in modo da indicare l'inizio caricamento e
957
- * in seconda istanza un altro evento in cui **data** sarà sempre valorizzato, o con il Dto da usare per recuperare i dati, o con i dati
958
- * veri e propri già presenti nel **DataArray**
959
- *
960
- * I callback **onLoadStart** e **onLoadEnd** vengono sempre chiamati
961
- *
962
- * @param {{ data: LineChartData | PieChartData | Vertical2DChartData | VerticalChartData | any, index: number }} nd Indice del caricamento dati, con eventualmente già i dati se disponibili
963
- */
964
- changePage(nd) {
965
- if (!nd.data) {
966
- this.loadingChart = true;
967
- // Serve per informare l'applicativo in listening sull'indice attualmente in visualizzazione.
968
- // La mancanza di dati indica che non devono essere effettuate ricerche per ora
969
- if (this.DataRetrieve)
970
- this.DataRetrieve(null, nd.index);
971
- this.onLoadStart.emit();
972
- return;
973
- }
974
- if (this.DataRetrieve)
975
- this.DataRetrieve(nd.data, nd.index).then(t => { this.changePageDataReceived(t); });
976
- else
977
- this.changePageDataReceived(nd.data);
978
- }
979
- /**
980
- * Al termine del caricamento dei dati di una pagina questo metodo viene chiamato per rigraficare la situazione con i nuovi dati
981
- *
982
- * @param {LineChartData | PieChartData | Vertical2DChartData | VerticalChartData | any} data Dati del grafico
983
- */
984
- changePageDataReceived(data) {
985
- this.loadingChart = false;
986
- this.onLoadEnd.emit();
987
- let firstBind = !this.Data;
988
- this.Data = data;
989
- if (!firstBind)
990
- this.reloadChart();
991
- else
992
- this.dispatchLoadChart();
993
- }
994
- /**
995
- * Ricarica il grafico distruggendo il vecchio e ricreando il nuovo
996
- *
997
- * Le chiamate a questo metodo possono essere trasformate in chiamate al metodo **graphicate** della Service, se solo quel metodo fosse abbastanza intelligente per capire
998
- * le differenze fra il grafico com'era prima e come deve diventare, in modo da non ricrearlo ma semplicemente modificare quello che già è disegnato
999
- */
1000
- reloadChart() {
1001
- this.browserOnly(() => {
1002
- if (!this.Chart.isDisposed())
1003
- this.Chart.dispose();
1004
- this.Dispatcher.deregisterGraph(this.name);
1005
- });
1006
- this.Dispatcher.register(this.name, () => { return this.loadChart(); });
1007
- }
1008
- /**
1009
- * Permette di aggiungere un blocco di dati in maniera "live" ad un grafico
1010
- */
1011
- addData(chartData) {
1012
- this.ChartService.refreshData(chartData);
1013
- }
1014
- ;
1015
- /**
1016
- * Funzione che si occupa di caricare i temi necessari per il grafico in oggetto. Prima applica il tema, poi, se serve, applica le animazioni
1017
- */
1018
- setupAmChartsThemes() {
1019
- return Promise.all([
1020
- this.Charter.applyTheme(am4core, this.Theme).then(() => {
1021
- return this.Animations ? this.Charter.applyAnimations(am4core) : this.Charter.unapplyAnimations(am4core);
1022
- })
1023
- ]);
1024
- }
1025
- /**
1026
- * @ignore
1027
- */
1028
- log(log) {
1029
- if (this.logs)
1030
- console.log("@esfaenza/es-charts: " + log);
1031
- }
1032
- /**
1033
- * Imposta lo zoom dal **from** al **to**
1034
- *
1035
- * @param {Date} from Inizio dello zoom
1036
- * @param {Date} to Fine dello zoom
1037
- */
1038
- setSelection(from, to) {
1039
- this.ChartService.setSelection(from, to);
1040
- }
1041
- /**
1042
- * @ignore
1043
- */
1044
- browserOnly(f) {
1045
- if (isPlatformBrowser(this.platformId)) {
1046
- this.zone.runOutsideAngular(() => {
1047
- f();
1048
- });
1049
- }
1050
- }
1051
- }
1052
- BaseChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseChartComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
1053
- BaseChartComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: BaseChartComponent, inputs: { XTitle: "XTitle", YTitle: "YTitle", Settings: "Settings", Legend: "Legend", LegendPosition: "LegendPosition", Timeline: "Timeline", name: "name", Animations: "Animations", Theme: "Theme", Locale: "Locale", HideSeriesOnLabelClick: "HideSeriesOnLabelClick", MinGridDistance: "MinGridDistance", AdaptLabelSizeAndOrientation: "AdaptLabelSizeAndOrientation", LegendPadding: "LegendPadding", DataDtos: "DataDtos", DataDtoStartIndex: "DataDtoStartIndex", DataRetrieve: "DataRetrieve", BrowseDelayMs: "BrowseDelayMs" }, outputs: { onSelectionChanged: "onSelectionChanged", onSeriesClicked: "onSeriesClicked", onLoadStart: "onLoadStart", onLoadEnd: "onLoadEnd", chartLoaded: "chartLoaded" }, queries: [{ propertyName: "header_tr", first: true, predicate: ["header"], descendants: true }, { propertyName: "loading_template", first: true, predicate: ["loading"], descendants: true }], usesOnChanges: true, ngImport: i0 });
1054
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseChartComponent, decorators: [{
1055
- type: Directive
1056
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Object }, { type: i0.NgZone }, { type: ChartLoader }, { type: ChartDispatcher }, { type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }]; }, propDecorators: { XTitle: [{
1057
- type: Input
1058
- }], YTitle: [{
1059
- type: Input
1060
- }], Settings: [{
1061
- type: Input
1062
- }], Legend: [{
1063
- type: Input
1064
- }], LegendPosition: [{
1065
- type: Input
1066
- }], Timeline: [{
1067
- type: Input
1068
- }], name: [{
1069
- type: Input
1070
- }], Animations: [{
1071
- type: Input
1072
- }], Theme: [{
1073
- type: Input
1074
- }], Locale: [{
1075
- type: Input
1076
- }], HideSeriesOnLabelClick: [{
1077
- type: Input
1078
- }], MinGridDistance: [{
1079
- type: Input
1080
- }], AdaptLabelSizeAndOrientation: [{
1081
- type: Input
1082
- }], LegendPadding: [{
1083
- type: Input
1084
- }], DataDtos: [{
1085
- type: Input
1086
- }], DataDtoStartIndex: [{
1087
- type: Input
1088
- }], DataRetrieve: [{
1089
- type: Input
1090
- }], BrowseDelayMs: [{
1091
- type: Input
1092
- }], header_tr: [{
1093
- type: ContentChild,
1094
- args: ['header', { static: false }]
1095
- }], loading_template: [{
1096
- type: ContentChild,
1097
- args: ['loading', { static: false }]
1098
- }], onSelectionChanged: [{
1099
- type: Output
1100
- }], onSeriesClicked: [{
1101
- type: Output
1102
- }], onLoadStart: [{
1103
- type: Output
1104
- }], onLoadEnd: [{
1105
- type: Output
1106
- }], chartLoaded: [{
1107
- type: Output
1108
- }] } });
1109
-
1110
- /**
1111
- * Classe il cui unico scopo è gestire il setup e rendering di un LineChart
1112
- */
1113
- class LineChartService {
1114
- /** @ignore */
1115
- constructor(Adapter, dateExts) {
1116
- this.Adapter = Adapter;
1117
- this.dateExts = dateExts;
1118
- /** @ignore */
1119
- this.DataGroupBucketSize = 1500;
1120
- /** @ignore */
1121
- this.OpacityOnSelected = 0.3;
1122
- /** @ignore */
1123
- this.OpacityOnFill = 0.75;
1124
- /** @ignore */
1125
- this.singleDataSet = false;
1126
- //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
1127
- //TODO: spostarla in un metodo di utilità (esfaenza/extensions)
1128
- /** @ignore */
1129
- this.executionTimers = {};
1130
- }
1131
- /**
1132
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un LineChart
1133
- */
1134
- graphicate(data, settings) {
1135
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1136
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1137
- let threshold = (_a = settings.DataGroupingThreshold) !== null && _a !== void 0 ? _a : 3000;
1138
- this.singleDataSet = (_b = settings.MergeDatasets) !== null && _b !== void 0 ? _b : false;
1139
- let showTicks = settings.ShowTicks == null ? true : settings === null || settings === void 0 ? void 0 : settings.ShowTicks;
1140
- let dataShouldBeGrouped = Math.max(...dataConverted.series.map(t => t.values.length)) > threshold;
1141
- let showTimeline = settings.Timeline || dataShouldBeGrouped;
1142
- let seriesWithInterval = dataConverted.series.some(t => t.interval);
1143
- let interval = seriesWithInterval ? dataConverted.series.find(t => t.interval).interval : null;
1144
- let gapsAllowed = (settings === null || settings === void 0 ? void 0 : settings.AllowGaps) == null ? seriesWithInterval : settings === null || settings === void 0 ? void 0 : settings.AllowGaps;
1145
- let finalInstant = (_c = settings === null || settings === void 0 ? void 0 : settings.FinalInstants) !== null && _c !== void 0 ? _c : true;
1146
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1147
- am4core.options.autoDispose = true;
1148
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1149
- let ChartInstanceCasted = this.ChartInstance;
1150
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1151
- if (settings.YAxisTitle) {
1152
- yAxis.title.text = settings.YAxisTitle;
1153
- yAxis.title.fontWeight = "bold";
1154
- }
1155
- if (settings.Min)
1156
- yAxis.min = settings.Min;
1157
- if (settings.Max)
1158
- yAxis.max = settings.Max;
1159
- let limitNullOrUndef = dataConverted.limit == null || dataConverted.limit == undefined;
1160
- let limits = limitNullOrUndef ? [] : !dataConverted.limit.length ? [dataConverted.limit] : dataConverted.limit;
1161
- if (limits.length > 0) {
1162
- for (let i = 0; i < limits.length; i++) {
1163
- let limit = limits[i];
1164
- if (limit.upper != null && limit.upper != undefined && limit.lower != null && limit.lower != undefined) {
1165
- let range = yAxis.axisRanges.create();
1166
- range.value = limit.lower;
1167
- range.endValue = limit.upper;
1168
- if (limit.fillColor) {
1169
- range.contents.stroke = am4core.color(limit.fillColor);
1170
- range.contents.fill = range.contents.stroke;
1171
- }
1172
- range.label.inside = true;
1173
- range.label.text = limit.upperlabel;
1174
- range.label.fill = range.grid.stroke;
1175
- range.label.verticalCenter = "bottom";
1176
- range.label.stroke = am4core.color(limit.uppercolor || "#F92200");
1177
- range.grid.stroke = am4core.color(limit.uppercolor || "#F92200");
1178
- range.grid.strokeWidth = 2;
1179
- range.grid.strokeOpacity = 1;
1180
- }
1181
- else if ((limit.lower == null || limit.lower == undefined) && limit.upper != null && limit.upper != undefined) {
1182
- let range = yAxis.axisRanges.create();
1183
- range.value = limit.upper;
1184
- range.label.inside = true;
1185
- range.label.text = limit.upperlabel;
1186
- range.label.fill = range.grid.stroke;
1187
- range.label.verticalCenter = "bottom";
1188
- range.label.stroke = am4core.color(limit.uppercolor || "#F92200");
1189
- range.grid.stroke = am4core.color(limit.uppercolor || "#F92200");
1190
- range.grid.strokeWidth = 2;
1191
- range.grid.strokeOpacity = 1;
1192
- }
1193
- else if ((limit.upper == null || limit.upper == undefined) && limit.lower != null && limit.lower != undefined) {
1194
- let range = yAxis.axisRanges.create();
1195
- range.value = limit.lower;
1196
- range.label.inside = true;
1197
- range.label.text = limit.lowerlabel;
1198
- range.label.fill = range.grid.stroke;
1199
- range.label.verticalCenter = "bottom";
1200
- range.label.stroke = am4core.color(limit.lowercolor || "#F92200");
1201
- range.grid.stroke = am4core.color(limit.lowercolor || "#F92200");
1202
- range.grid.strokeWidth = 2;
1203
- range.grid.strokeOpacity = 1;
1204
- }
1205
- }
1206
- }
1207
- this.dateAxis = ChartInstanceCasted.xAxes.push(new am4charts.DateAxis());
1208
- // Per comatibilità col codice scritto quando non era a livello globale, mi scoccia sostituire
1209
- let dateAxis = this.dateAxis;
1210
- if (settings.XAxisTitle) {
1211
- dateAxis.title.text = settings.XAxisTitle;
1212
- dateAxis.title.fontWeight = "bold";
1213
- }
1214
- if (showTicks) {
1215
- dateAxis.renderer.ticks.template.disabled = false;
1216
- dateAxis.renderer.ticks.template.strokeOpacity = 1;
1217
- dateAxis.renderer.ticks.template.stroke = am4core.color("#495C43");
1218
- dateAxis.renderer.ticks.template.strokeWidth = 2;
1219
- dateAxis.renderer.ticks.template.length = 10;
1220
- dateAxis.renderer.ticks.template.location = 0;
1221
- }
1222
- dateAxis.renderer.minGridDistance = (_d = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _d !== void 0 ? _d : 50;
1223
- dateAxis.renderer.grid.template.location = 0;
1224
- dateAxis.minZoomCount = 5;
1225
- dateAxis.groupData = dataShouldBeGrouped;
1226
- dateAxis.groupCount = (_e = settings.DataGroupBucketSize) !== null && _e !== void 0 ? _e : this.DataGroupBucketSize;
1227
- //Se ho almeno una serie ad intervallo e i settings non mi impediscono esplicitamente di usare i gaps, visualizzo i dati col gap
1228
- if (gapsAllowed) {
1229
- if (!seriesWithInterval) {
1230
- console.error("Per utilizzare la funzionalità dei gap è obbligatorio definire un intervallo nelle serie del grafico");
1231
- return null;
1232
- }
1233
- dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
1234
- }
1235
- if (showTimeline)
1236
- ChartInstanceCasted.scrollbarX = new am4charts.XYChartScrollbar();
1237
- let seriesToPush = [];
1238
- let seriesColors = [];
1239
- let defaultIndex = 0;
1240
- // Ordinamento dei dati se serve
1241
- dataConverted.series.forEach((s) => {
1242
- if (s.values[0] && !(s.values[0].d instanceof Date)) {
1243
- for (let v = 0; v < s.values.length; v++)
1244
- s.values[v].d = new Date(s.values[v].d);
1245
- }
1246
- var correctOrder = true;
1247
- var prevDate = null;
1248
- for (let v = 0; v < s.values.length; v++) {
1249
- if (!prevDate)
1250
- prevDate = s.values[v].d;
1251
- else if (s.values[v].d < prevDate) {
1252
- correctOrder = false;
1253
- break;
1254
- }
1255
- }
1256
- if (!correctOrder)
1257
- s.values.sort((d1, d2) => d1.d.getTime() - d2.d.getTime());
1258
- });
1259
- // Generazione di un unico dataset invece che N, per poter gestire un unico tooltip
1260
- if (this.singleDataSet) {
1261
- this.ChartInstance.data = this.generateSingleDataset(dataConverted);
1262
- ;
1263
- dateAxis.cursorTooltipEnabled = false;
1264
- }
1265
- dataConverted.series.forEach((s, index) => {
1266
- var _a, _b, _c, _d;
1267
- let stacked = s.stacked != null && s.stacked != undefined ? s.stacked : ((_a = settings === null || settings === void 0 ? void 0 : settings.Stacked) !== null && _a !== void 0 ? _a : false);
1268
- let fill = stacked || (s.fill != null && s.fill != undefined ? s.fill : ((_b = settings === null || settings === void 0 ? void 0 : settings.Fill) !== null && _b !== void 0 ? _b : false));
1269
- let series = (settings === null || settings === void 0 ? void 0 : settings.Step) ? new am4charts.StepLineSeries() : new am4charts.LineSeries();
1270
- series.dataFields.valueY = "v" + (this.singleDataSet ? index : "");
1271
- series.dataFields.dateX = "d";
1272
- series.measureUnit = s.uom;
1273
- series.name = s.name;
1274
- series.strokeWidth = (_c = settings === null || settings === void 0 ? void 0 : settings.StrokeSize) !== null && _c !== void 0 ? _c : 1;
1275
- series.connect = !gapsAllowed;
1276
- series.minBulletDistance = 10;
1277
- series.tooltipText = this.singleDataSet ? "" : s.name ? "{name}: [bold]{valueY}[/]" : "[bold]{valueY}[/]";
1278
- series.tooltip.pointerOrientation = "vertical";
1279
- series.tooltip.background.fillOpacity = 0.5;
1280
- series.tooltip.label.padding(12, 12, 12, 12);
1281
- series.fillOpacity = fill ? this.OpacityOnFill : 0.0001;
1282
- series.stacked = stacked;
1283
- series.hidden = s.hidden;
1284
- //Dataset singolo, i dati sono registrati a livello di chart, creo il tooltip che permette di vederli tutti insieme
1285
- //altrimenti assegno i dati della serie direttamente alla serie
1286
- if (this.singleDataSet) {
1287
- series.tooltip.getFillFromObject = false;
1288
- series.tooltip.background.fill = am4core.color("#eee");
1289
- series.tooltip.label.fill = am4core.color("#00");
1290
- series.tooltip.defaultState.transitionDuration = 0;
1291
- series.tooltip.hiddenState.transitionDuration = 0;
1292
- //Utilizzo il mio dateService per la formattazione della data in modo che non debba mai gestire n formati fra n librerie... bellissimo
1293
- series.dateFormatter.format = (source) => {
1294
- if (interval && finalInstant && ["hour", "minute", "second"].includes(interval.timeunit)) {
1295
- let timepart = null;
1296
- switch (interval.timeunit) {
1297
- case "hour":
1298
- timepart = 'day';
1299
- break;
1300
- case "minute":
1301
- timepart = 'hour';
1302
- break;
1303
- case "second":
1304
- timepart = 'minute';
1305
- break;
1306
- }
1307
- if (timepart)
1308
- return this.dateExts.adjustDateToFinalInstant(source, timepart, interval ? interval.timeunit == "second" : false);
1309
- }
1310
- else
1311
- return this.dateExts.getFormatted(source, interval ? ["day", "week", "month", "year"].includes(interval.timeunit) : false, interval ? interval.timeunit == "second" : false);
1312
- };
1313
- series.adapter.add("tooltipText", () => {
1314
- var text = "[bold]{dateX.formatDate()}[/]\n";
1315
- this.ChartInstance.series.each((item) => {
1316
- let uom = " [font-style: italic]" + series.measureUnit || "" + "[/]";
1317
- text += "[" + item.stroke.hex + "]●[/] " + (item.name ? (item.name + ": ") : "") + "[bold]{" + item.dataFields.valueY + "}[/]" + uom + "\n";
1318
- });
1319
- return text;
1320
- });
1321
- }
1322
- else
1323
- series.data = s.values;
1324
- let segment = series.segments.template;
1325
- let hoverState = segment.states.create("hover");
1326
- hoverState.properties.strokeWidth = ((_d = settings === null || settings === void 0 ? void 0 : settings.StrokeSize) !== null && _d !== void 0 ? _d : 1) + 1;
1327
- let dimmed = segment.states.create("dimmed");
1328
- dimmed.properties.stroke = am4core.color("#dadada");
1329
- //Se la serie ha un colore, uso quello, altrimenti pesco dai colori di default andando in ordine
1330
- if (s.color)
1331
- seriesColors.push(am4core.color(s.color));
1332
- else {
1333
- seriesColors.push(ChartInstanceCasted.colors.list[defaultIndex % ChartInstanceCasted.colors.list.length]);
1334
- defaultIndex++;
1335
- }
1336
- seriesToPush.push(series);
1337
- });
1338
- ChartInstanceCasted.colors.list = seriesColors;
1339
- //Scrivo le serie nel grafico
1340
- seriesToPush.forEach(s => {
1341
- ChartInstanceCasted.series.push(s);
1342
- if (showTimeline)
1343
- ChartInstanceCasted.scrollbarX.series.push(s);
1344
- });
1345
- if (settings.Legend) {
1346
- this.ChartInstance.legend = new am4charts.Legend();
1347
- this.ChartInstance.legend.position = (_f = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _f !== void 0 ? _f : 'right';
1348
- this.ChartInstance.legend.scrollable = true;
1349
- this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
1350
- this.ChartInstance.legend.itemContainers.template.events.on("over", (event) => { this.processOver(event.target.dataItem.dataContext); });
1351
- this.ChartInstance.legend.itemContainers.template.events.on("out", () => { this.processOut(); });
1352
- if (settings.LegendPadding) {
1353
- let template = this.ChartInstance.legend.itemContainers.template;
1354
- template.paddingTop = (_g = settings.LegendPadding.top) !== null && _g !== void 0 ? _g : 0;
1355
- template.paddingBottom = (_h = settings.LegendPadding.bottom) !== null && _h !== void 0 ? _h : 0;
1356
- template.paddingLeft = (_j = settings.LegendPadding.left) !== null && _j !== void 0 ? _j : 0;
1357
- template.paddingRight = (_k = settings.LegendPadding.right) !== null && _k !== void 0 ? _k : 0;
1358
- }
1359
- }
1360
- this.ChartInstance.cursor = new am4charts.XYCursor();
1361
- //Prove******************************************************************************************************************************
1362
- // this.ChartInstance.cursor.events.on("cursorpositionchanged", (ev) => {
1363
- // //var value = dateAxis.positionToDate(dateAxis.toAxisPosition(ev.target.xPosition));
1364
- // var dt = dateAxis.series.values.find(t => t.dataItem.values.dateX);
1365
- // if (dt && dt.dataItem) {
1366
- // console.log(dt.dataItem.values);
1367
- // // this.ChartInstance.tooltipText = dt;
1368
- // }
1369
- // else {
1370
- // this.ChartInstance.tooltipText = "";
1371
- // }
1372
- // });
1373
- //******************************************************************************************************************************
1374
- this.ChartInstance.cursor.xAxis = dateAxis;
1375
- this.ChartInstance.cursor.yAxis = yAxis;
1376
- if (this.singleDataSet)
1377
- this.ChartInstance.cursor.maxTooltipDistance = -1;
1378
- //TODO: Cercare di capire perché è figlio di puttana......
1379
- dateAxis.events.on("startchanged", t => this.emitSelectionChanged(t, settings));
1380
- dateAxis.events.on("endchanged", t => this.emitSelectionChanged(t, settings));
1381
- return this;
1382
- }
1383
- /** @ignore */
1384
- setSelection(from, to) {
1385
- this.dateAxis.zoomToDates(from, to, true, true);
1386
- }
1387
- /** @ignore */
1388
- refreshData(data) {
1389
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1390
- if (this.singleDataSet) {
1391
- var data = this.generateSingleDataset(dataConverted);
1392
- this.ChartInstance.addData(data);
1393
- return;
1394
- }
1395
- throw "Impossibile aggiornare i dati senza unire il dataset. Si prega di impostare [MergeDatasets] a true";
1396
- }
1397
- /** Partendo da dati divisi per seriue genera un dataset unito con la data come chiave e i vari valori dopo */
1398
- generateSingleDataset(data) {
1399
- let dto = {};
1400
- data.series.forEach((vs, index) => {
1401
- for (let i = 0; i < vs.values.length; i++) {
1402
- var dataitem = vs.values[i];
1403
- var indexer = new Date(dataitem.d).valueOf();
1404
- if (!dto[indexer])
1405
- dto[indexer] = {};
1406
- dto[indexer]['v' + index] = dataitem.v;
1407
- }
1408
- });
1409
- var dates = Object.keys(dto);
1410
- var ret = [];
1411
- for (let i = 0; i < dates.length; i++) {
1412
- let values = dto[dates[i]];
1413
- let item = { d: new Date(parseInt(dates[i])) };
1414
- var vals = Object.keys(values);
1415
- for (let ii = 0; ii < vals.length; ii++) {
1416
- let series = vals[ii];
1417
- let singleVal = values[series];
1418
- item[series] = singleVal;
1419
- }
1420
- ret.push(item);
1421
- }
1422
- return ret;
1423
- }
1424
- /** @ignore */
1425
- emitSelectionChanged(ev, settings) {
1426
- if (settings.OnSelectionChangedCallback) {
1427
- this.throttla("selchange", () => {
1428
- var axis = ev.target;
1429
- var start = new Date(axis.minZoomed);
1430
- var end = new Date(axis.maxZoomed);
1431
- var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
1432
- settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
1433
- }, 150);
1434
- }
1435
- }
1436
- /** @ignore */
1437
- processOver(hoveredSeries) {
1438
- hoveredSeries.zIndex = 999;
1439
- let fill = hoveredSeries.fillOpacity == this.OpacityOnFill;
1440
- hoveredSeries.segments.each((segment) => {
1441
- segment.setState("hover");
1442
- if (!fill)
1443
- segment.fillSprite.fillOpacity = this.OpacityOnSelected;
1444
- });
1445
- if (!fill)
1446
- hoveredSeries.legendDataItem.marker.children.getIndex(1).fillOpacity = this.OpacityOnSelected;
1447
- this.ChartInstance.series.each((series) => {
1448
- if (series != hoveredSeries) {
1449
- let fill = series.fillOpacity == this.OpacityOnFill;
1450
- series.segments.each((segment) => {
1451
- segment.setState("dimmed");
1452
- if (!fill)
1453
- segment.fillSprite.fillOpacity = 0;
1454
- });
1455
- }
1456
- });
1457
- }
1458
- /** @ignore */
1459
- processOut() {
1460
- this.ChartInstance.series.each((series, i) => {
1461
- series.zIndex = i;
1462
- let fill = series.fillOpacity == this.OpacityOnFill;
1463
- series.segments.each((segment) => {
1464
- segment.setState("default");
1465
- if (!fill)
1466
- segment.fillSprite.fillOpacity = 0;
1467
- });
1468
- if (!fill)
1469
- series.legendDataItem.marker.children.getIndex(1).fillOpacity = 0;
1470
- });
1471
- }
1472
- /** @ignore */
1473
- throttla(id, func, throttleTime) {
1474
- //Se ho la funzione che vuole eseguire ripulisco quel timeout
1475
- if (this.executionTimers[id])
1476
- clearTimeout(this.executionTimers[id]);
1477
- //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
1478
- this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
1479
- }
1480
- }
1481
-
1482
- /**
1483
- * Classe il cui unico scopo è gestire il setup e rendering di un PieChart
1484
- */
1485
- class PieChartService {
1486
- /** @ignore */
1487
- constructor(Adapter) {
1488
- this.Adapter = Adapter;
1489
- /** @ignore */
1490
- this.ViewAbsoluteValues = true;
1491
- }
1492
- /**
1493
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un PieChart
1494
- */
1495
- graphicate(data, settings) {
1496
- var _a, _b, _c, _d;
1497
- if (settings.Timeline) {
1498
- console.error("Timeline not supported for pie chart");
1499
- return null;
1500
- }
1501
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1502
- am4core.options.autoDispose = true;
1503
- this.ChartInstance = am4core.create(settings.Name, settings.Mode3D ? am4charts.PieChart3D : am4charts.PieChart);
1504
- this.ChartInstance.innerRadius = ((settings.DonutRadiusPercentage || 15) / 100) * settings.ContainerHeight;
1505
- let series = this.ChartInstance.series.push(settings.Mode3D ? new am4charts.PieSeries3D() : new am4charts.PieSeries());
1506
- series.dataFields.value = "v";
1507
- series.dataFields.category = "k";
1508
- //Il default sono valori percentuali
1509
- if (this.ViewAbsoluteValues) {
1510
- series.legendSettings.valueText = "{value}";
1511
- series.labels.template.text = "{category}: [bold]{value}[/]";
1512
- }
1513
- series.slices.template.stroke = am4core.color("#fff");
1514
- series.slices.template.strokeOpacity = 1;
1515
- series.slices.template.togglable = false;
1516
- series.hiddenState.properties.opacity = 1;
1517
- series.hiddenState.properties.endAngle = -90;
1518
- series.hiddenState.properties.startAngle = -90;
1519
- if (settings.HideZeroes == null ? true : settings.HideZeroes) {
1520
- series.ticks.template.events.on("ready", this.hideZeroes);
1521
- series.ticks.template.events.on("visibilitychanged", this.hideZeroes);
1522
- series.labels.template.events.on("ready", this.hideZeroes);
1523
- series.labels.template.events.on("visibilitychanged", this.hideZeroes);
1524
- }
1525
- series.slices.template.events.on("hit", (ev) => {
1526
- if (settings.OnSeriesClickCallback) {
1527
- let clickedSeries = ev.target.dataItem.dataContext.k;
1528
- settings.OnSeriesClickCallback(clickedSeries);
1529
- }
1530
- });
1531
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForPieChart(data) : data;
1532
- let defaultIndex = 0;
1533
- for (let i = 0; i < dataConverted.values.length; i++) {
1534
- if (!dataConverted.values[i].c) {
1535
- dataConverted.values[i].c = this.ChartInstance.colors.list[defaultIndex % this.ChartInstance.colors.list.length];
1536
- defaultIndex++;
1537
- }
1538
- else
1539
- dataConverted.values[i].c = am4core.color(dataConverted.values[i].c);
1540
- }
1541
- series.slices.template.propertyFields.fill = "c";
1542
- this.ChartInstance.data = dataConverted.values;
1543
- if (!settings.LabelsVisible) {
1544
- series.labels.template.disabled = true;
1545
- series.ticks.template.disabled = true;
1546
- }
1547
- else if (settings.LabelsWrap || settings.LabelsTruncate) {
1548
- series.labels.template.maxWidth = settings.LabelsWidth || 100;
1549
- if (settings.LabelsWrap)
1550
- series.labels.template.wrap = true;
1551
- else if (settings.LabelsTruncate)
1552
- series.labels.template.truncate = true;
1553
- }
1554
- if (settings.Legend) {
1555
- let legend = new am4charts.Legend();
1556
- this.ChartInstance.legend = legend;
1557
- legend.position = (settings === null || settings === void 0 ? void 0 : settings.LegendPosition) || "bottom";
1558
- legend.itemContainers.template.togglable = settings.HideSeriesOnLabelClick === true;
1559
- legend.itemContainers.template.tooltipText = "{category}";
1560
- //Se la legenda non fa il toggle della serie la considero come se fosse un click sulla serie in se
1561
- if (!settings.HideSeriesOnLabelClick) {
1562
- legend.itemContainers.template.events.on("hit", (ev) => {
1563
- if (settings.OnSeriesClickCallback) {
1564
- let clickedSeries = ev.target.dataItem.dataContext.legendDataItem.name;
1565
- settings.OnSeriesClickCallback(clickedSeries);
1566
- }
1567
- });
1568
- }
1569
- if (settings.LegendPadding) {
1570
- let template = this.ChartInstance.legend.itemContainers.template;
1571
- template.paddingTop = (_a = settings.LegendPadding.top) !== null && _a !== void 0 ? _a : 0;
1572
- template.paddingBottom = (_b = settings.LegendPadding.bottom) !== null && _b !== void 0 ? _b : 0;
1573
- template.paddingLeft = (_c = settings.LegendPadding.left) !== null && _c !== void 0 ? _c : 0;
1574
- template.paddingRight = (_d = settings.LegendPadding.right) !== null && _d !== void 0 ? _d : 0;
1575
- }
1576
- }
1577
- return this;
1578
- }
1579
- /** @ignore */
1580
- setSelection(from, to) {
1581
- }
1582
- /** @ignore */
1583
- refreshData(data) {
1584
- //TODO:IMPL
1585
- }
1586
- /** @ignore */
1587
- hideZeroes(ev) {
1588
- if (ev.target.dataItem && (ev.target.dataItem.values.value.percent == 0))
1589
- ev.target.hide();
1590
- else
1591
- ev.target.show();
1592
- }
1593
- }
1594
-
1595
- /**
1596
- * Classe il cui unico scopo è gestire il setup e rendering di un VerticalChart
1597
- */
1598
- class VerticalChartService {
1599
- /** @ignore */
1600
- constructor(Adapter) {
1601
- this.Adapter = Adapter;
1602
- /** @ignore */
1603
- this.dangerZone = 50;
1604
- /** @ignore */
1605
- this.LabelWidth = 150;
1606
- /** @ignore */
1607
- this.LabelRightWhenCompressed = 20;
1608
- /** @ignore */
1609
- this.LabelTopWhenCompressed = -5;
1610
- /** @ignore */
1611
- this.DefaultColumnWidthPercentage = 85;
1612
- }
1613
- /**
1614
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalChart
1615
- */
1616
- graphicate(data, settings) {
1617
- var _a, _b, _c, _d, _e, _f, _g, _h;
1618
- if (settings.Timeline) {
1619
- console.error("Timeline not supported for vertical chart");
1620
- return null;
1621
- }
1622
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1623
- am4core.options.autoDispose = true;
1624
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1625
- let ChartInstanceCasted = this.ChartInstance;
1626
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForVerticalChart(data) : data;
1627
- ChartInstanceCasted.data = dataConverted.values;
1628
- let noStrokes = dataConverted.values.some(t => !!t.c);
1629
- if (settings.Legend) {
1630
- ChartInstanceCasted.legend = new am4charts.Legend();
1631
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1632
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1633
- if (settings.LegendPadding) {
1634
- let template = this.ChartInstance.legend.itemContainers.template;
1635
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1636
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1637
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1638
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1639
- }
1640
- }
1641
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1642
- if (settings.YAxisTitle) {
1643
- yAxis.title.text = settings.YAxisTitle;
1644
- yAxis.title.fontWeight = "bold";
1645
- }
1646
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1647
- if (settings.XAxisTitle) {
1648
- categoryAxis.title.text = settings.XAxisTitle;
1649
- categoryAxis.title.fontWeight = "bold";
1650
- }
1651
- categoryAxis.dataFields.category = "k";
1652
- categoryAxis.renderer.grid.template.location = 0;
1653
- categoryAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 30;
1654
- let label = categoryAxis.renderer.labels.template;
1655
- label.truncate = true;
1656
- label.maxWidth = (_g = settings.LabelWidth) !== null && _g !== void 0 ? _g : this.LabelWidth;
1657
- label.tooltipText = "{category}";
1658
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1659
- categoryAxis.events.on("sizechanged", (ev) => {
1660
- var _a, _b, _c;
1661
- let axis = ev.target;
1662
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1663
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1664
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1665
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1666
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1667
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1668
- axis.renderer.labels.template.horizontalCenter = "right";
1669
- axis.renderer.labels.template.verticalCenter = "middle";
1670
- }
1671
- else {
1672
- axis.renderer.labels.template.rotation = 0;
1673
- axis.renderer.labels.template.dx = 0;
1674
- axis.renderer.labels.template.dy = 0;
1675
- axis.renderer.labels.template.horizontalCenter = "middle";
1676
- axis.renderer.labels.template.verticalCenter = "top";
1677
- }
1678
- });
1679
- }
1680
- // Create series
1681
- let series = ChartInstanceCasted.series.push(new am4charts.ColumnSeries());
1682
- series.dataFields.valueY = "v";
1683
- series.dataFields.categoryX = "k";
1684
- series.name = "";
1685
- let columnTemplate = series.columns.template;
1686
- columnTemplate.tooltipText = "{categoryX}: [bold]{valueY}[/] {t}";
1687
- columnTemplate.fillOpacity = .8;
1688
- columnTemplate.width = am4core.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
1689
- if (noStrokes) {
1690
- columnTemplate.strokeOpacity = 0;
1691
- columnTemplate.strokeWidth = 0;
1692
- columnTemplate.adapter.add("fill", (_, target) => am4core.color(target.dataItem.dataContext.c));
1693
- }
1694
- else {
1695
- columnTemplate.strokeWidth = 2;
1696
- columnTemplate.strokeOpacity = 1;
1697
- }
1698
- return this;
1699
- }
1700
- /** @ignore */
1701
- setSelection(from, to) {
1702
- }
1703
- /** @ignore */
1704
- refreshData(data) {
1705
- //TODO:IMPL
1706
- }
1707
- }
1708
-
1709
- /**
1710
- * Classe il cui unico scopo è gestire il setup e rendering di un Vertical2DChart
1711
- */
1712
- class Vertical2DChartService {
1713
- /** @ignore */
1714
- constructor(Adapter) {
1715
- this.Adapter = Adapter;
1716
- /** @ignore */
1717
- this.DefaultGroupPaddingPercentage = 5;
1718
- /** @ignore */
1719
- this.dangerZone = 50;
1720
- /** @ignore */
1721
- this.LabelWidth = 150;
1722
- /** @ignore */
1723
- this.LabelRightWhenCompressed = 20;
1724
- /** @ignore */
1725
- this.LabelTopWhenCompressed = -5;
1726
- /** @ignore */
1727
- this.DefaultColumnWidthPercentage = 85;
1728
- }
1729
- /**
1730
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un Vertical2DChart
1731
- */
1732
- graphicate(data, settings) {
1733
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1734
- if (settings.Timeline) {
1735
- console.error("Timeline not supported for vertical chart");
1736
- return null;
1737
- }
1738
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1739
- am4core.options.autoDispose = true;
1740
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1741
- let ChartInstanceCasted = this.ChartInstance;
1742
- if (settings.Legend) {
1743
- ChartInstanceCasted.legend = new am4charts.Legend();
1744
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1745
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1746
- if (settings.LegendPadding) {
1747
- let template = this.ChartInstance.legend.itemContainers.template;
1748
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1749
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1750
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1751
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1752
- }
1753
- }
1754
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1755
- if (settings.YAxisTitle) {
1756
- yAxis.title.text = settings.YAxisTitle;
1757
- yAxis.title.fontWeight = "bold";
1758
- }
1759
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1760
- if (settings.XAxisTitle) {
1761
- categoryAxis.title.text = settings.XAxisTitle;
1762
- categoryAxis.title.fontWeight = "bold";
1763
- }
1764
- yAxis.min = 0;
1765
- categoryAxis.dataFields.category = 'key';
1766
- categoryAxis.renderer.cellStartLocation = am4core.percent((_f = settings.GroupPaddingPercentage) !== null && _f !== void 0 ? _f : this.DefaultGroupPaddingPercentage).value;
1767
- categoryAxis.renderer.cellEndLocation = am4core.percent(100 - ((_g = settings.GroupPaddingPercentage) !== null && _g !== void 0 ? _g : this.DefaultGroupPaddingPercentage)).value;
1768
- categoryAxis.renderer.grid.template.location = 0;
1769
- categoryAxis.renderer.minGridDistance = (_h = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _h !== void 0 ? _h : 30;
1770
- let label = categoryAxis.renderer.labels.template;
1771
- label.truncate = true;
1772
- label.maxWidth = (_j = settings.LabelWidth) !== null && _j !== void 0 ? _j : this.LabelWidth;
1773
- label.tooltipText = "{category}";
1774
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1775
- categoryAxis.events.on("sizechanged", (ev) => {
1776
- var _a, _b, _c;
1777
- let axis = ev.target;
1778
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1779
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1780
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1781
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1782
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1783
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1784
- axis.renderer.labels.template.horizontalCenter = "right";
1785
- axis.renderer.labels.template.verticalCenter = "middle";
1786
- }
1787
- else {
1788
- axis.renderer.labels.template.rotation = 0;
1789
- axis.renderer.labels.template.dx = 0;
1790
- axis.renderer.labels.template.dy = 0;
1791
- axis.renderer.labels.template.horizontalCenter = "middle";
1792
- axis.renderer.labels.template.verticalCenter = "top";
1793
- }
1794
- });
1795
- }
1796
- let dataPreConverted = this.Adapter ? this.Adapter.adaptDataForVertical2DChart(data) : data;
1797
- let dataConverted = [];
1798
- for (let i = 0; i < dataPreConverted.groups.length; i++) {
1799
- let item = dataPreConverted.groups[i];
1800
- let obj = { key: item.name };
1801
- for (let p = 0; p < item.values.length; p++) {
1802
- let value = item.values[p];
1803
- obj[value.k] = value.v;
1804
- }
1805
- dataConverted.push(obj);
1806
- }
1807
- ChartInstanceCasted.data = dataConverted;
1808
- if (dataPreConverted.colorinfos)
1809
- ChartInstanceCasted.colors.list = dataPreConverted.colorinfos.map(c => am4core.color(c.color));
1810
- //Prendo la prima categoria e mi baso sulle proprietà per dfeinire le serie
1811
- for (let prop in dataConverted[0])
1812
- if (prop !== "key")
1813
- this.createSeries(ChartInstanceCasted, settings, prop, prop);
1814
- return this;
1815
- }
1816
- /** @ignore */
1817
- setSelection(from, to) {
1818
- }
1819
- /** @ignore */
1820
- refreshData(data) {
1821
- //TODO:IMPL
1822
- }
1823
- /** @ignore */
1824
- createSeries(chart, settings, value, name) {
1825
- var _a;
1826
- let series = chart.series.push(new am4charts.ColumnSeries());
1827
- series.dataFields.valueY = value;
1828
- series.dataFields.categoryX = 'key';
1829
- series.name = name;
1830
- series.columns.template.tooltipText = "{name} {categoryX}: [bold]{valueY}[/]";
1831
- series.columns.template.fillOpacity = .8;
1832
- series.columns.template.width = am4core.percent((_a = settings.ColumnWidthPercentage) !== null && _a !== void 0 ? _a : this.DefaultColumnWidthPercentage);
1833
- series.events.on("hidden", () => this.arrangeColumns);
1834
- series.events.on("shown", () => this.arrangeColumns);
1835
- return series;
1836
- }
1837
- /** @ignore */
1838
- arrangeColumns() {
1839
- let ChartInstanceCasted = this.ChartInstance;
1840
- let series = ChartInstanceCasted.series.getIndex(0);
1841
- let xAxis = ChartInstanceCasted.xAxes.getIndex(0);
1842
- let w = 1 - xAxis.renderer.cellStartLocation - (1 - xAxis.renderer.cellEndLocation);
1843
- if (series.dataItems.length > 1) {
1844
- let x0 = xAxis.getX(series.dataItems.getIndex(0), "categoryX");
1845
- let x1 = xAxis.getX(series.dataItems.getIndex(1), "categoryX");
1846
- let delta = ((x1 - x0) / ChartInstanceCasted.series.length) * w;
1847
- if (am4core.isNumber(delta)) {
1848
- let middle = ChartInstanceCasted.series.length / 2;
1849
- let newIndex = 0;
1850
- ChartInstanceCasted.series.each((series) => {
1851
- if (!series.isHidden && !series.isHiding) {
1852
- series.dummyData = newIndex;
1853
- newIndex++;
1854
- }
1855
- else {
1856
- series.dummyData = ChartInstanceCasted.series.indexOf(series);
1857
- }
1858
- });
1859
- let visibleCount = newIndex;
1860
- let newMiddle = visibleCount / 2;
1861
- ChartInstanceCasted.series.each((series) => {
1862
- let trueIndex = ChartInstanceCasted.series.indexOf(series);
1863
- let newIndex = series.dummyData;
1864
- let dx = (newIndex - trueIndex + middle - newMiddle) * delta;
1865
- series.animate({ property: "dx", to: dx }, series.interpolationDuration, series.interpolationEasing);
1866
- series.bulletsContainer.animate({ property: "dx", to: dx }, series.interpolationDuration, series.interpolationEasing);
1867
- });
1868
- }
1869
- }
1870
- }
1871
- }
1872
-
1873
- /**
1874
- * Classe il cui unico scopo è gestire il setup e rendering di un VerticalStackedChart
1875
- */
1876
- class VerticalStackedChartService {
1877
- /** @ignore */
1878
- constructor(Adapter) {
1879
- this.Adapter = Adapter;
1880
- /** @ignore */
1881
- this.dangerZone = 50;
1882
- /** @ignore */
1883
- this.LabelWidth = 150;
1884
- /** @ignore */
1885
- this.LabelRightWhenCompressed = 20;
1886
- /** @ignore */
1887
- this.LabelTopWhenCompressed = -5;
1888
- /** @ignore */
1889
- this.DefaultColumnWidthPercentage = 85;
1890
- }
1891
- /**
1892
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalStackedChart
1893
- */
1894
- graphicate(data, settings) {
1895
- var _a, _b, _c, _d, _e, _f, _g;
1896
- if (settings.Timeline) {
1897
- console.error("Timeline not supported for vertical chart");
1898
- return null;
1899
- }
1900
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1901
- am4core.options.autoDispose = true;
1902
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1903
- let ChartInstanceCasted = this.ChartInstance;
1904
- // Create axes
1905
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1906
- if (settings.YAxisTitle) {
1907
- yAxis.title.text = settings.YAxisTitle;
1908
- yAxis.title.fontWeight = "bold";
1909
- }
1910
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1911
- if (settings.XAxisTitle) {
1912
- categoryAxis.title.text = settings.XAxisTitle;
1913
- categoryAxis.title.fontWeight = "bold";
1914
- }
1915
- yAxis.min = 0;
1916
- categoryAxis.dataFields.category = "key";
1917
- categoryAxis.renderer.grid.template.location = 0;
1918
- categoryAxis.renderer.minGridDistance = (_a = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _a !== void 0 ? _a : 30;
1919
- let label = categoryAxis.renderer.labels.template;
1920
- label.truncate = true;
1921
- label.maxWidth = (_b = settings.LabelWidth) !== null && _b !== void 0 ? _b : this.LabelWidth;
1922
- label.tooltipText = "{category}";
1923
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1924
- categoryAxis.events.on("sizechanged", (ev) => {
1925
- var _a, _b, _c;
1926
- let axis = ev.target;
1927
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1928
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1929
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1930
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1931
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1932
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1933
- axis.renderer.labels.template.horizontalCenter = "right";
1934
- axis.renderer.labels.template.verticalCenter = "middle";
1935
- }
1936
- else {
1937
- axis.renderer.labels.template.rotation = 0;
1938
- axis.renderer.labels.template.dx = 0;
1939
- axis.renderer.labels.template.dy = 0;
1940
- axis.renderer.labels.template.horizontalCenter = "middle";
1941
- axis.renderer.labels.template.verticalCenter = "top";
1942
- }
1943
- });
1944
- }
1945
- let dataPreConverted = this.Adapter ? this.Adapter.adaptDataForVerticalStackedChart(data) : data;
1946
- let dataConverted = [];
1947
- for (let i = 0; i < dataPreConverted.groups.length; i++) {
1948
- let item = dataPreConverted.groups[i];
1949
- let obj = { key: item.name };
1950
- for (let p = 0; p < item.values.length; p++) {
1951
- let value = item.values[p];
1952
- obj[value.k] = value.v;
1953
- }
1954
- dataConverted.push(obj);
1955
- }
1956
- ChartInstanceCasted.data = dataConverted;
1957
- //Prendo la prima categoria e mi baso sulle proprietà per dfeinire le serie
1958
- for (let prop in dataConverted[0]) {
1959
- if (prop !== "key")
1960
- this.createSeriesStacked(ChartInstanceCasted, settings, prop, prop);
1961
- }
1962
- if (settings.Legend) {
1963
- ChartInstanceCasted.legend = new am4charts.Legend();
1964
- ChartInstanceCasted.legend.position = (_c = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _c !== void 0 ? _c : 'right';
1965
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1966
- if (settings.LegendPadding) {
1967
- let template = this.ChartInstance.legend.itemContainers.template;
1968
- template.paddingTop = (_d = settings.LegendPadding.top) !== null && _d !== void 0 ? _d : 0;
1969
- template.paddingBottom = (_e = settings.LegendPadding.bottom) !== null && _e !== void 0 ? _e : 0;
1970
- template.paddingLeft = (_f = settings.LegendPadding.left) !== null && _f !== void 0 ? _f : 0;
1971
- template.paddingRight = (_g = settings.LegendPadding.right) !== null && _g !== void 0 ? _g : 0;
1972
- }
1973
- }
1974
- return this;
1975
- }
1976
- /** @ignore */
1977
- setSelection(from, to) {
1978
- }
1979
- /** @ignore */
1980
- refreshData(data) {
1981
- //TODO:IMPL
1982
- }
1983
- /** @ignore */
1984
- createSeriesStacked(chart, settings, field, name) {
1985
- var _a;
1986
- // Set up series
1987
- let series = chart.series.push(new am4charts.ColumnSeries());
1988
- series.name = name;
1989
- series.dataFields.valueY = field;
1990
- series.dataFields.categoryX = "key";
1991
- series.sequencedInterpolation = true;
1992
- series.columns.template.tooltipText = "{name} {categoryX}: [bold]{valueY}[/]";
1993
- series.columns.template.fillOpacity = .8;
1994
- series.columns.template.width = am4core.percent((_a = settings.ColumnWidthPercentage) !== null && _a !== void 0 ? _a : this.DefaultColumnWidthPercentage);
1995
- // Make it stacked
1996
- series.stacked = true;
1997
- return series;
1998
- }
1999
- }
2000
-
2001
- /**
2002
- * Classe il cui unico scopo è gestire il setup e rendering di un AreaChart
2003
- */
2004
- class AreaChartService {
2005
- /** @ignore */
2006
- constructor(Adapter) {
2007
- this.Adapter = Adapter;
2008
- //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
2009
- //TODO: spostarla in un metodo di utilità (esfaenza/extensions)
2010
- /** @ignore */
2011
- this.executionTimers = {};
2012
- }
2013
- /**
2014
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un AreaChart
2015
- */
2016
- graphicate(data, settings) {
2017
- var _a, _b, _c, _d, _e, _f;
2018
- if (settings.Timeline) {
2019
- console.error("Timeline not supported for area chart");
2020
- return null;
2021
- }
2022
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForAreaChart(data) : data;
2023
- let showTicks = settings.ShowTicks == null ? true : settings === null || settings === void 0 ? void 0 : settings.ShowTicks;
2024
- let interval = dataConverted.interval;
2025
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
2026
- am4core.options.autoDispose = true;
2027
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
2028
- let ChartInstanceCasted = this.ChartInstance;
2029
- if (settings.Legend) {
2030
- ChartInstanceCasted.legend = new am4charts.Legend();
2031
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
2032
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
2033
- if (settings.LegendPadding) {
2034
- let template = this.ChartInstance.legend.itemContainers.template;
2035
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
2036
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
2037
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
2038
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
2039
- }
2040
- }
2041
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
2042
- yAxis.tooltip.disabled = true;
2043
- if (settings.YAxisTitle) {
2044
- yAxis.title.text = settings.YAxisTitle;
2045
- yAxis.title.fontWeight = "bold";
2046
- }
2047
- yAxis.min = 0;
2048
- let dateAxis = ChartInstanceCasted.xAxes.push(new am4charts.DateAxis());
2049
- dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
2050
- dateAxis.startLocation = 0.5;
2051
- dateAxis.endLocation = 0.5;
2052
- if (settings.XAxisTitle) {
2053
- dateAxis.title.text = settings.XAxisTitle;
2054
- dateAxis.title.fontWeight = "bold";
2055
- }
2056
- if (showTicks) {
2057
- dateAxis.renderer.ticks.template.disabled = false;
2058
- dateAxis.renderer.ticks.template.strokeOpacity = 1;
2059
- dateAxis.renderer.ticks.template.stroke = am4core.color("#495C43");
2060
- dateAxis.renderer.ticks.template.strokeWidth = 2;
2061
- dateAxis.renderer.ticks.template.length = 10;
2062
- dateAxis.renderer.ticks.template.location = 0;
2063
- }
2064
- if (!!interval)
2065
- dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
2066
- // Unisco il dataset e tiro fuori i dati
2067
- let chartData = [];
2068
- let seriesToMakeCache = {};
2069
- let seriesToMake = [];
2070
- for (let i = 0; i < dataConverted.groups.length; i++) {
2071
- let group = dataConverted.groups[i];
2072
- let dataItem = { date: group.name };
2073
- for (let ii = 0; ii < group.values.length; ii++) {
2074
- let val = group.values[ii];
2075
- dataItem[val.k] = val.v;
2076
- if (!seriesToMakeCache[val.k]) {
2077
- seriesToMakeCache[val.k] = true;
2078
- seriesToMake.push(val.k);
2079
- }
2080
- }
2081
- chartData.push(dataItem);
2082
- }
2083
- ChartInstanceCasted.data = chartData;
2084
- //---------------------------------------------------------
2085
- seriesToMake.forEach(s => { this.createSeries(ChartInstanceCasted, s); });
2086
- ChartInstanceCasted.cursor = new am4charts.XYCursor();
2087
- ChartInstanceCasted.cursor.xAxis = dateAxis;
2088
- dateAxis.events.on("startchanged", t => this.emitSelectionChanged(t, settings));
2089
- dateAxis.events.on("endchanged", t => this.emitSelectionChanged(t, settings));
2090
- return this;
2091
- }
2092
- /** @ignore */
2093
- setSelection(from, to) {
2094
- }
2095
- /** @ignore */
2096
- refreshData(data) {
2097
- //TODO:IMPL
2098
- }
2099
- /** @ignore */
2100
- emitSelectionChanged(ev, settings) {
2101
- if (settings.OnSelectionChangedCallback) {
2102
- this.throttla("selchange", () => {
2103
- var axis = ev.target;
2104
- var start = new Date(axis.minZoomed);
2105
- var end = new Date(axis.maxZoomed);
2106
- var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
2107
- settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
2108
- }, 150);
2109
- }
2110
- }
2111
- /** @ignore */
2112
- createSeries(chart, name) {
2113
- let series = chart.series.push(new am4charts.LineSeries());
2114
- series.dataFields.dateX = "date";
2115
- series.name = name[0].toUpperCase() + name.slice(1);
2116
- series.dataFields.valueY = name;
2117
- series.tooltipText = "[#000]{valueY.value}[/]";
2118
- //series.tooltip.background.fill = am4core.color("#FFF");
2119
- series.tooltip.getStrokeFromObject = true;
2120
- series.tooltip.background.strokeWidth = 3;
2121
- series.tooltip.getFillFromObject = false;
2122
- series.fillOpacity = 0.6;
2123
- series.strokeWidth = 2;
2124
- series.stacked = true;
2125
- return series;
2126
- }
2127
- /** @ignore */
2128
- throttla(id, func, throttleTime) {
2129
- //Se ho la funzione che vuole eseguire ripulisco quel timeout
2130
- if (this.executionTimers[id])
2131
- clearTimeout(this.executionTimers[id]);
2132
- //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
2133
- this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
2134
- }
2135
- }
2136
-
2137
- /**
2138
- * Componente specifico per la graficazione di un qualsiasi tipo di grafico.
2139
- *
2140
- * Si basa sul tipo specificato dalla proprietà **Type**
2141
- */
2142
- class EsChartComponent extends BaseChartComponent {
2143
- /**
2144
- * @ignore
2145
- */
2146
- constructor(el, ChartLoader, ChartDispatcher, dateService, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2147
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2148
- this.dateService = dateService;
2149
- this.adapter = adapter;
2150
- }
2151
- /**
2152
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2153
- */
2154
- getSpecificPropertiesToCheck() {
2155
- return ["Data", "Type"];
2156
- }
2157
- /**
2158
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2159
- *
2160
- * @returns {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} Settings castati al tipo giusto
2161
- */
2162
- getCastedSettings() {
2163
- var _a, _b, _c, _d, _e, _f;
2164
- switch (this.Type) {
2165
- case 'pie':
2166
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new PieChartSettings());
2167
- case 'area':
2168
- return ((_b = this.Settings) !== null && _b !== void 0 ? _b : new AreaChartSettings());
2169
- case 'line':
2170
- return ((_c = this.Settings) !== null && _c !== void 0 ? _c : new LineChartSettings());
2171
- case 'vertical':
2172
- return ((_d = this.Settings) !== null && _d !== void 0 ? _d : new VerticalChartSettings());
2173
- case 'vertical-2d':
2174
- return ((_e = this.Settings) !== null && _e !== void 0 ? _e : new Vertical2DChartSettings());
2175
- case 'vertical-stacked':
2176
- return ((_f = this.Settings) !== null && _f !== void 0 ? _f : new VerticalStackedChartSettings());
2177
- }
2178
- }
2179
- /**
2180
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2181
- *
2182
- * @param {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} settingsCasted Settings castati al tipo giusto
2183
- */
2184
- fillSpecificSettings(settingsCasted) {
2185
- // Nope. Se si usa l'es-chart si danno i settings con l'oggetto
2186
- }
2187
- /**
2188
- * Effettua il rendering di questo grafico in base ai Settings
2189
- *
2190
- * @param {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} settingsCasted Impostazioni di graficazione
2191
- * @returns {PieChartService | AreaChartService | LineChartService | VerticalChartService | Vertical2DChartService | VerticalStackedChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2192
- */
2193
- graphicate(settings) {
2194
- switch (this.Type) {
2195
- case 'pie':
2196
- return new PieChartService(this.adapter).graphicate(this.Data, settings);
2197
- case 'area':
2198
- return new AreaChartService(this.adapter).graphicate(this.Data, settings);
2199
- case 'line':
2200
- return new LineChartService(this.adapter, this.dateService).graphicate(this.Data, settings);
2201
- case 'vertical':
2202
- return new VerticalChartService(this.adapter).graphicate(this.Data, settings);
2203
- case 'vertical-2d':
2204
- return new Vertical2DChartService(this.adapter).graphicate(this.Data, settings);
2205
- case 'vertical-stacked':
2206
- return new VerticalStackedChartService(this.adapter).graphicate(this.Data, settings);
2207
- }
2208
- }
2209
- }
2210
- EsChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: i3.DateService }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2211
- EsChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsChartComponent, selector: "es-chart", inputs: { Type: "Type", Data: "Data", DataArray: "DataArray" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartComponent, decorators: [{
2213
- type: Component,
2214
- args: [{ selector: 'es-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2215
- }], ctorParameters: function () {
2216
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: i3.DateService }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2217
- type: Inject,
2218
- args: [PLATFORM_ID]
2219
- }] }, { type: undefined, decorators: [{
2220
- type: Inject,
2221
- args: [ESC_DEBUG_MODE]
2222
- }] }, { type: undefined, decorators: [{
2223
- type: Inject,
2224
- args: [ESC_ANIMATIONS]
2225
- }] }, { type: undefined, decorators: [{
2226
- type: Inject,
2227
- args: [ESC_THEME]
2228
- }] }, { type: i4.LocalizationService }];
2229
- }, propDecorators: { Type: [{
2230
- type: Input
2231
- }], Data: [{
2232
- type: Input
2233
- }], DataArray: [{
2234
- type: Input
2235
- }] } });
2236
-
2237
- /**
2238
- * Componente specifico per la graficazione di un grafico ad Area
2239
- */
2240
- class EsAreaChartComponent extends BaseChartComponent {
2241
- /**
2242
- * @ignore
2243
- */
2244
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2245
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2246
- this.adapter = adapter;
2247
- }
2248
- /**
2249
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2250
- */
2251
- getSpecificPropertiesToCheck() {
2252
- return ["Data", "DataArray"];
2253
- }
2254
- /**
2255
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2256
- *
2257
- * @returns {AreaChartSettings} Settings castati al tipo giusto
2258
- */
2259
- getCastedSettings() {
2260
- var _a;
2261
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new AreaChartSettings());
2262
- }
2263
- /**
2264
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2265
- *
2266
- * @param {AreaChartSettings} settingsCasted Settings castati al tipo giusto
2267
- */
2268
- fillSpecificSettings(settingsCasted) {
2269
- }
2270
- /**
2271
- * Effettua il rendering di questo grafico in base ai Settings
2272
- *
2273
- * @param {AreaChartSettings} settingsCasted Impostazioni di graficazione
2274
- * @returns {AreaChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2275
- */
2276
- graphicate(settingsCasted) {
2277
- return new AreaChartService(this.adapter).graphicate(this.Data, settingsCasted);
2278
- }
2279
- }
2280
- EsAreaChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsAreaChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2281
- EsAreaChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsAreaChartComponent, selector: "es-area-chart", inputs: { Data: "Data", DataArray: "DataArray" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsAreaChartComponent, decorators: [{
2283
- type: Component,
2284
- args: [{ selector: 'es-area-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2285
- }], ctorParameters: function () {
2286
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2287
- type: Inject,
2288
- args: [PLATFORM_ID]
2289
- }] }, { type: undefined, decorators: [{
2290
- type: Inject,
2291
- args: [ESC_DEBUG_MODE]
2292
- }] }, { type: undefined, decorators: [{
2293
- type: Inject,
2294
- args: [ESC_ANIMATIONS]
2295
- }] }, { type: undefined, decorators: [{
2296
- type: Inject,
2297
- args: [ESC_THEME]
2298
- }] }, { type: i4.LocalizationService }];
2299
- }, propDecorators: { Data: [{
2300
- type: Input
2301
- }], DataArray: [{
2302
- type: Input
2303
- }] } });
2304
-
2305
- /**
2306
- * Componente specifico per la graficazione di un grafico a Linea su un asse temporale
2307
- */
2308
- class EsLineChartComponent extends BaseChartComponent {
2309
- /**
2310
- * @ignore
2311
- */
2312
- constructor(el, ChartLoader, ChartDispatcher, adapter, dateService, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2313
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2314
- this.adapter = adapter;
2315
- this.dateService = dateService;
2316
- }
2317
- /**
2318
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2319
- */
2320
- getSpecificPropertiesToCheck() {
2321
- return ["Data", "DataArray", "Step", "DataGroupBucketSize", "DataGroupingThreshold", "StrokeSize", "Stacked", "AllowGaps", "MergeDatasets", "FinalInstants", "Fill", "Min", "Max"];
2322
- }
2323
- /**
2324
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2325
- *
2326
- * @returns {LineChartSettings} Settings castati al tipo giusto
2327
- */
2328
- getCastedSettings() {
2329
- var _a;
2330
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new LineChartSettings());
2331
- }
2332
- /**
2333
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2334
- *
2335
- * @param {LineChartSettings} settingsCasted Settings castati al tipo giusto
2336
- */
2337
- fillSpecificSettings(settingsCasted) {
2338
- settingsCasted.Step = settingsCasted.Step != null ? settingsCasted.Step : this.Step;
2339
- settingsCasted.DataGroupBucketSize = settingsCasted.DataGroupBucketSize != null ? settingsCasted.DataGroupBucketSize : this.DataGroupBucketSize;
2340
- settingsCasted.StrokeSize = settingsCasted.StrokeSize != null ? settingsCasted.StrokeSize : this.StrokeSize;
2341
- settingsCasted.DataGroupingThreshold = settingsCasted.DataGroupingThreshold != null ? settingsCasted.DataGroupingThreshold : this.DataGroupingThreshold;
2342
- settingsCasted.AllowGaps = settingsCasted.AllowGaps != null ? settingsCasted.AllowGaps : this.AllowGaps;
2343
- settingsCasted.MergeDatasets = settingsCasted.MergeDatasets != null ? settingsCasted.MergeDatasets : this.MergeDatasets;
2344
- settingsCasted.FinalInstants = settingsCasted.FinalInstants != null ? settingsCasted.FinalInstants : this.FinalInstants;
2345
- settingsCasted.Min = settingsCasted.Min != null ? settingsCasted.Min : this.Min;
2346
- settingsCasted.Max = settingsCasted.Max != null ? settingsCasted.Max : this.Max;
2347
- settingsCasted.Fill = settingsCasted.Fill != null ? settingsCasted.Fill : this.Fill;
2348
- settingsCasted.Stacked = settingsCasted.Stacked != null ? settingsCasted.Stacked : this.Stacked;
2349
- }
2350
- /**
2351
- * Effettua il rendering di questo grafico in base ai Settings
2352
- *
2353
- * @param {LineChartSettings} settingsCasted Impostazioni di graficazione
2354
- * @returns {LineChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2355
- */
2356
- graphicate(settingsCasted) {
2357
- return new LineChartService(this.adapter, this.dateService).graphicate(this.Data, settingsCasted);
2358
- }
2359
- }
2360
- EsLineChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsLineChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i3.DateService }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2361
- EsLineChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsLineChartComponent, selector: "es-line-chart", inputs: { Data: "Data", DataArray: "DataArray", Step: "Step", DataGroupBucketSize: "DataGroupBucketSize", DataGroupingThreshold: "DataGroupingThreshold", StrokeSize: "StrokeSize", AllowGaps: "AllowGaps", MergeDatasets: "MergeDatasets", FinalInstants: "FinalInstants", Min: "Min", Max: "Max", Fill: "Fill", Stacked: "Stacked" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsLineChartComponent, decorators: [{
2363
- type: Component,
2364
- args: [{ selector: 'es-line-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2365
- }], ctorParameters: function () {
2366
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i3.DateService }, { type: i0.NgZone }, { type: Object, decorators: [{
2367
- type: Inject,
2368
- args: [PLATFORM_ID]
2369
- }] }, { type: undefined, decorators: [{
2370
- type: Inject,
2371
- args: [ESC_DEBUG_MODE]
2372
- }] }, { type: undefined, decorators: [{
2373
- type: Inject,
2374
- args: [ESC_ANIMATIONS]
2375
- }] }, { type: undefined, decorators: [{
2376
- type: Inject,
2377
- args: [ESC_THEME]
2378
- }] }, { type: i4.LocalizationService }];
2379
- }, propDecorators: { Data: [{
2380
- type: Input
2381
- }], DataArray: [{
2382
- type: Input
2383
- }], Step: [{
2384
- type: Input
2385
- }], DataGroupBucketSize: [{
2386
- type: Input
2387
- }], DataGroupingThreshold: [{
2388
- type: Input
2389
- }], StrokeSize: [{
2390
- type: Input
2391
- }], AllowGaps: [{
2392
- type: Input
2393
- }], MergeDatasets: [{
2394
- type: Input
2395
- }], FinalInstants: [{
2396
- type: Input
2397
- }], Min: [{
2398
- type: Input
2399
- }], Max: [{
2400
- type: Input
2401
- }], Fill: [{
2402
- type: Input
2403
- }], Stacked: [{
2404
- type: Input
2405
- }] } });
2406
-
2407
- /**
2408
- * Componente specifico per la graficazione di un grafico a Torta
2409
- */
2410
- class EsPieChartComponent extends BaseChartComponent {
2411
- /**
2412
- * @ignore
2413
- */
2414
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2415
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2416
- this.adapter = adapter;
2417
- }
2418
- /**
2419
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2420
- */
2421
- getSpecificPropertiesToCheck() {
2422
- return ["Data", "DataArray", "HideZeroes", "Mode3D", "LabelsWrap", "LabelsTruncate", "LabelsWidth", "LabelsVisible"];
2423
- }
2424
- /**
2425
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2426
- *
2427
- * @returns {PieChartSettings} Settings castati al tipo giusto
2428
- */
2429
- getCastedSettings() {
2430
- var _a;
2431
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new PieChartSettings());
2432
- }
2433
- /**
2434
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2435
- *
2436
- * @param {PieChartSettings} settingsCasted Settings castati al tipo giusto
2437
- */
2438
- fillSpecificSettings(settingsCasted) {
2439
- settingsCasted.HideZeroes = settingsCasted.HideZeroes != null ? settingsCasted.HideZeroes : this.HideZeroes;
2440
- settingsCasted.Mode3D = settingsCasted.Mode3D != null ? settingsCasted.Mode3D : this.Mode3D;
2441
- settingsCasted.DonutRadiusPercentage = settingsCasted.DonutRadiusPercentage != null ? settingsCasted.DonutRadiusPercentage : this.DonutRadiusPercentage;
2442
- settingsCasted.LabelsWrap = settingsCasted.LabelsWrap != null ? settingsCasted.LabelsWrap : this.LabelsWrap;
2443
- settingsCasted.LabelsTruncate = settingsCasted.LabelsTruncate != null ? settingsCasted.LabelsTruncate : this.LabelsTruncate;
2444
- settingsCasted.LabelsWidth = settingsCasted.LabelsWidth != null ? settingsCasted.LabelsWidth : this.LabelsWidth;
2445
- settingsCasted.LabelsVisible = settingsCasted.LabelsVisible != null ? settingsCasted.LabelsVisible : this.LabelsVisible;
2446
- }
2447
- /**
2448
- * Effettua il rendering di questo grafico in base ai Settings
2449
- *
2450
- * @param {PieChartSettings} settingsCasted Impostazioni di graficazione
2451
- * @returns {PieChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2452
- */
2453
- graphicate(settingsCasted) {
2454
- return new PieChartService(this.adapter).graphicate(this.Data, settingsCasted);
2455
- }
2456
- }
2457
- EsPieChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsPieChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2458
- EsPieChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsPieChartComponent, selector: "es-pie-chart", inputs: { Data: "Data", DataArray: "DataArray", HideZeroes: "HideZeroes", Mode3D: "Mode3D", DonutRadiusPercentage: "DonutRadiusPercentage", LabelsWrap: "LabelsWrap", LabelsTruncate: "LabelsTruncate", LabelsWidth: "LabelsWidth", LabelsVisible: "LabelsVisible" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2459
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsPieChartComponent, decorators: [{
2460
- type: Component,
2461
- args: [{ selector: 'es-pie-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2462
- }], ctorParameters: function () {
2463
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2464
- type: Inject,
2465
- args: [PLATFORM_ID]
2466
- }] }, { type: undefined, decorators: [{
2467
- type: Inject,
2468
- args: [ESC_DEBUG_MODE]
2469
- }] }, { type: undefined, decorators: [{
2470
- type: Inject,
2471
- args: [ESC_ANIMATIONS]
2472
- }] }, { type: undefined, decorators: [{
2473
- type: Inject,
2474
- args: [ESC_THEME]
2475
- }] }, { type: i4.LocalizationService }];
2476
- }, propDecorators: { Data: [{
2477
- type: Input
2478
- }], DataArray: [{
2479
- type: Input
2480
- }], HideZeroes: [{
2481
- type: Input
2482
- }], Mode3D: [{
2483
- type: Input
2484
- }], DonutRadiusPercentage: [{
2485
- type: Input
2486
- }], LabelsWrap: [{
2487
- type: Input
2488
- }], LabelsTruncate: [{
2489
- type: Input
2490
- }], LabelsWidth: [{
2491
- type: Input
2492
- }], LabelsVisible: [{
2493
- type: Input
2494
- }] } });
2495
-
2496
- /**
2497
- * Componente specifico per la graficazione di un grafico a Barre con due dimensioni
2498
- */
2499
- class EsVertical2DChartComponent extends BaseChartComponent {
2500
- /**
2501
- * @ignore
2502
- */
2503
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2504
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2505
- this.adapter = adapter;
2506
- }
2507
- /**
2508
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2509
- */
2510
- getSpecificPropertiesToCheck() {
2511
- return ["Data", "DataArray"];
2512
- }
2513
- /**
2514
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2515
- *
2516
- * @returns {Vertical2DChartSettings} Settings castati al tipo giusto
2517
- */
2518
- getCastedSettings() {
2519
- var _a;
2520
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new Vertical2DChartSettings());
2521
- }
2522
- /**
2523
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2524
- *
2525
- * @param {Vertical2DChartSettings} settingsCasted Settings castati al tipo giusto
2526
- */
2527
- fillSpecificSettings(settingsCasted) {
2528
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2529
- settingsCasted.GroupPaddingPercentage = settingsCasted.GroupPaddingPercentage != null ? settingsCasted.GroupPaddingPercentage : this.GroupPaddingPercentage;
2530
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2531
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2532
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2533
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2534
- }
2535
- /**
2536
- * Effettua il rendering di questo grafico in base ai Settings
2537
- *
2538
- * @param {Vertical2DChartSettings} settingsCasted Impostazioni di graficazione
2539
- * @returns {Vertical2DChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2540
- */
2541
- graphicate(settingsCasted) {
2542
- return new Vertical2DChartService(this.adapter).graphicate(this.Data, settingsCasted);
2543
- }
2544
- }
2545
- EsVertical2DChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVertical2DChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2546
- EsVertical2DChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsVertical2DChartComponent, selector: "es-vertical-2d-chart", inputs: { Data: "Data", DataArray: "DataArray", ColumnWidthPercentage: "ColumnWidthPercentage", GroupPaddingPercentage: "GroupPaddingPercentage", LabelWidth: "LabelWidth", LabelVerticalOrientationCutoffWidth: "LabelVerticalOrientationCutoffWidth", LabelRightWhenCompressed: "LabelRightWhenCompressed", LabelTopWhenCompressed: "LabelTopWhenCompressed" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2547
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVertical2DChartComponent, decorators: [{
2548
- type: Component,
2549
- args: [{ selector: 'es-vertical-2d-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2550
- }], ctorParameters: function () {
2551
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2552
- type: Inject,
2553
- args: [PLATFORM_ID]
2554
- }] }, { type: undefined, decorators: [{
2555
- type: Inject,
2556
- args: [ESC_DEBUG_MODE]
2557
- }] }, { type: undefined, decorators: [{
2558
- type: Inject,
2559
- args: [ESC_ANIMATIONS]
2560
- }] }, { type: undefined, decorators: [{
2561
- type: Inject,
2562
- args: [ESC_THEME]
2563
- }] }, { type: i4.LocalizationService }];
2564
- }, propDecorators: { Data: [{
2565
- type: Input
2566
- }], DataArray: [{
2567
- type: Input
2568
- }], ColumnWidthPercentage: [{
2569
- type: Input
2570
- }], GroupPaddingPercentage: [{
2571
- type: Input
2572
- }], LabelWidth: [{
2573
- type: Input
2574
- }], LabelVerticalOrientationCutoffWidth: [{
2575
- type: Input
2576
- }], LabelRightWhenCompressed: [{
2577
- type: Input
2578
- }], LabelTopWhenCompressed: [{
2579
- type: Input
2580
- }] } });
2581
-
2582
- /**
2583
- * Componente specifico per la graficazione di un grafico a Barre
2584
- */
2585
- class EsVerticalChartComponent extends BaseChartComponent {
2586
- /**
2587
- * @ignore
2588
- */
2589
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2590
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2591
- this.adapter = adapter;
2592
- }
2593
- /**
2594
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2595
- */
2596
- getSpecificPropertiesToCheck() {
2597
- return ["Data", "DataArray"];
2598
- }
2599
- /**
2600
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2601
- *
2602
- * @returns {VerticalChartSettings} Settings castati al tipo giusto
2603
- */
2604
- getCastedSettings() {
2605
- var _a;
2606
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new VerticalChartSettings());
2607
- }
2608
- /**
2609
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2610
- *
2611
- * @param {VerticalChartSettings} settingsCasted Settings castati al tipo giusto
2612
- */
2613
- fillSpecificSettings(settingsCasted) {
2614
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2615
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2616
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2617
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2618
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2619
- }
2620
- /**
2621
- * Effettua il rendering di questo grafico in base ai Settings
2622
- *
2623
- * @param {VerticalChartSettings} settingsCasted Impostazioni di graficazione
2624
- * @returns {VerticalChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2625
- */
2626
- graphicate(settingsCasted) {
2627
- return new VerticalChartService(this.adapter).graphicate(this.Data, settingsCasted);
2628
- }
2629
- }
2630
- EsVerticalChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2631
- EsVerticalChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsVerticalChartComponent, selector: "es-vertical-chart", inputs: { Data: "Data", DataArray: "DataArray", ColumnWidthPercentage: "ColumnWidthPercentage", LabelWidth: "LabelWidth", LabelVerticalOrientationCutoffWidth: "LabelVerticalOrientationCutoffWidth", LabelRightWhenCompressed: "LabelRightWhenCompressed", LabelTopWhenCompressed: "LabelTopWhenCompressed" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2632
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalChartComponent, decorators: [{
2633
- type: Component,
2634
- args: [{ selector: 'es-vertical-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2635
- }], ctorParameters: function () {
2636
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2637
- type: Inject,
2638
- args: [PLATFORM_ID]
2639
- }] }, { type: undefined, decorators: [{
2640
- type: Inject,
2641
- args: [ESC_DEBUG_MODE]
2642
- }] }, { type: undefined, decorators: [{
2643
- type: Inject,
2644
- args: [ESC_ANIMATIONS]
2645
- }] }, { type: undefined, decorators: [{
2646
- type: Inject,
2647
- args: [ESC_THEME]
2648
- }] }, { type: i4.LocalizationService }];
2649
- }, propDecorators: { Data: [{
2650
- type: Input
2651
- }], DataArray: [{
2652
- type: Input
2653
- }], ColumnWidthPercentage: [{
2654
- type: Input
2655
- }], LabelWidth: [{
2656
- type: Input
2657
- }], LabelVerticalOrientationCutoffWidth: [{
2658
- type: Input
2659
- }], LabelRightWhenCompressed: [{
2660
- type: Input
2661
- }], LabelTopWhenCompressed: [{
2662
- type: Input
2663
- }] } });
2664
-
2665
- /**
2666
- * Componente specifico per la graficazione di un grafico a Barre in modalità Stacked (una serie sopra l'altra)
2667
- */
2668
- class EsVerticalStackedChartComponent extends BaseChartComponent {
2669
- /**
2670
- * @ignore
2671
- */
2672
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2673
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2674
- this.adapter = adapter;
2675
- }
2676
- /**
2677
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2678
- */
2679
- getSpecificPropertiesToCheck() {
2680
- return ["Data", "DataArray"];
2681
- }
2682
- /**
2683
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2684
- *
2685
- * @returns {VerticalStackedChartSettings} Settings castati al tipo giusto
2686
- */
2687
- getCastedSettings() {
2688
- var _a;
2689
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new VerticalStackedChartSettings());
2690
- }
2691
- /**
2692
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2693
- *
2694
- * @param {VerticalStackedChartSettings} settingsCasted Settings castati al tipo giusto
2695
- */
2696
- fillSpecificSettings(settingsCasted) {
2697
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2698
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2699
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2700
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2701
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2702
- }
2703
- /**
2704
- * Effettua il rendering di questo grafico in base ai Settings
2705
- *
2706
- * @param {VerticalStackedChartSettings} settingsCasted Impostazioni di graficazione
2707
- * @returns {VerticalStackedChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2708
- */
2709
- graphicate(settingsCasted) {
2710
- return new VerticalStackedChartService(this.adapter).graphicate(this.Data, settingsCasted);
2711
- }
2712
- }
2713
- EsVerticalStackedChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalStackedChartComponent, deps: [{ token: i0.ElementRef }, { token: ChartLoader }, { token: ChartDispatcher }, { token: BaseAdapter }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: ESC_DEBUG_MODE }, { token: ESC_ANIMATIONS }, { token: ESC_THEME }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2714
- EsVerticalStackedChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EsVerticalStackedChartComponent, selector: "es-vertical-stacked-chart", inputs: { Data: "Data", DataArray: "DataArray", ColumnWidthPercentage: "ColumnWidthPercentage", LabelWidth: "LabelWidth", LabelVerticalOrientationCutoffWidth: "LabelVerticalOrientationCutoffWidth", LabelRightWhenCompressed: "LabelRightWhenCompressed", LabelTopWhenCompressed: "LabelTopWhenCompressed" }, usesInheritance: true, ngImport: i0, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PageChartSelector, selector: "chart-pager", inputs: ["Items", "Dtos", "BrowseDelayMs", "StartIndex"], outputs: ["onPageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalStackedChartComponent, decorators: [{
2716
- type: Component,
2717
- args: [{ selector: 'es-vertical-stacked-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<chart-pager *ngIf=\"isPaged\" (onPageChange)=\"changePage($event)\" [Items]=\"DataArray\" [Dtos]=\"DataDtos\" [StartIndex]=\"DataDtoStartIndex\"\r\n [BrowseDelayMs]=\"BrowseDelayMs\">\r\n <ng-template #header_inner let-headerItem>\r\n <ng-container *ngTemplateOutlet=\"header_tr; context : {$implicit: headerItem}\"></ng-container>\r\n </ng-template>\r\n</chart-pager>\r\n\r\n<ng-container *ngIf=\"loadingChart && loading_template\">\r\n <div style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <ng-container *ngTemplateOutlet=\"loading_template\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"loadingChart && !loading_template\">\r\n <div class=\"esc-loading-overlay\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\">\r\n <p class=\"label\">Loading....</p>\r\n </div>\r\n</ng-container>\r\n\r\n<div [class.hide-block]=\"loadingChart\" id=\"{{name}}\" style=\"width: 100%;\" [style.height]=\"isPaged ? 'calc(100% - 44px)' : '100%'\"></div>", styles: [".esc-loading-overlay{background:rgba(153,153,153,.6);text-transform:uppercase;font-size:30px;font-weight:700;color:#fff;text-align:center;font-family:monospace}.esc-loading-overlay .label{margin:0;padding-top:7%}.hide-block{display:none}\n"] }]
2718
- }], ctorParameters: function () {
2719
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2720
- type: Inject,
2721
- args: [PLATFORM_ID]
2722
- }] }, { type: undefined, decorators: [{
2723
- type: Inject,
2724
- args: [ESC_DEBUG_MODE]
2725
- }] }, { type: undefined, decorators: [{
2726
- type: Inject,
2727
- args: [ESC_ANIMATIONS]
2728
- }] }, { type: undefined, decorators: [{
2729
- type: Inject,
2730
- args: [ESC_THEME]
2731
- }] }, { type: i4.LocalizationService }];
2732
- }, propDecorators: { Data: [{
2733
- type: Input
2734
- }], DataArray: [{
2735
- type: Input
2736
- }], ColumnWidthPercentage: [{
2737
- type: Input
2738
- }], LabelWidth: [{
2739
- type: Input
2740
- }], LabelVerticalOrientationCutoffWidth: [{
2741
- type: Input
2742
- }], LabelRightWhenCompressed: [{
2743
- type: Input
2744
- }], LabelTopWhenCompressed: [{
2745
- type: Input
2746
- }] } });
2747
-
2748
- /**
2749
- * Classe che identifica i dati per un grafico generico paginato
2750
- */
2751
- class PagedChartData {
2752
- /**
2753
- * Costruttore
2754
- *
2755
- * @param {T} data Dati del grafico
2756
- * @param {string} title Titolo del grafico
2757
- * @param {Object} dataRetrieveDto Dto utilizzato per recuperare i dati di questo grafico
2758
- * @param {Function} dataRetrieveFunction Funzione utilizzata per ottenere i dati di questo grafico
2759
- */
2760
- constructor(data, title, dataRetrieveDto, dataRetrieveFunction) {
2761
- this.data = data;
2762
- this.title = title;
2763
- this.dataRetrieveDto = dataRetrieveDto;
2764
- this.dataRetrieveFunction = dataRetrieveFunction;
2765
- }
2766
- }
2767
-
2768
- /** Componenti esportati dal modulo */
2769
- const COMPONENTS = [
2770
- EsChartComponent,
2771
- EsLineChartComponent,
2772
- EsPieChartComponent,
2773
- EsVertical2DChartComponent,
2774
- EsVerticalChartComponent,
2775
- EsVerticalStackedChartComponent,
2776
- PageChartSelector,
2777
- EsAreaChartComponent
2778
- ];
2779
- class EsChartsModule {
2780
- static forRoot(config) {
2781
- return {
2782
- ngModule: EsChartsModule,
2783
- providers: [
2784
- ChartLoader,
2785
- ChartDispatcher,
2786
- { provide: ESC_ANIMATIONS, useValue: (config === null || config === void 0 ? void 0 : config.animations) == null || (config === null || config === void 0 ? void 0 : config.animations) == undefined ? true : config === null || config === void 0 ? void 0 : config.animations },
2787
- { provide: ESC_THEME, useValue: (config === null || config === void 0 ? void 0 : config.theme) || 'spiritedaway' },
2788
- { provide: ESC_DEBUG_MODE, useValue: (config === null || config === void 0 ? void 0 : config.debugMode) || false },
2789
- { provide: BaseAdapter, useClass: (config === null || config === void 0 ? void 0 : config.adapter) || BaseAdapter }
2790
- ]
2791
- };
2792
- }
2793
- }
2794
- EsChartsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2795
- EsChartsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, declarations: [EsChartComponent,
2796
- EsLineChartComponent,
2797
- EsPieChartComponent,
2798
- EsVertical2DChartComponent,
2799
- EsVerticalChartComponent,
2800
- EsVerticalStackedChartComponent,
2801
- PageChartSelector,
2802
- EsAreaChartComponent], imports: [CommonModule], exports: [EsChartComponent,
2803
- EsLineChartComponent,
2804
- EsPieChartComponent,
2805
- EsVertical2DChartComponent,
2806
- EsVerticalChartComponent,
2807
- EsVerticalStackedChartComponent,
2808
- PageChartSelector,
2809
- EsAreaChartComponent] });
2810
- EsChartsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, imports: [CommonModule] });
2811
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, decorators: [{
2812
- type: NgModule,
2813
- args: [{
2814
- imports: [CommonModule],
2815
- declarations: [...COMPONENTS],
2816
- exports: [...COMPONENTS]
2817
- }]
2818
- }] });
2819
-
2820
- /*
2821
- * Public API Surface of es-charts
2822
- */
2823
-
2824
- /**
2825
- * Generated bundle index. Do not edit.
2826
- */
2827
-
2828
- export { AreaChartData, AreaChartSettings, BaseAdapter, BaseChartComponent, BaseInterval, BaseSettings, ChartThemes, DateValue, ESC_ANIMATIONS, ESC_DEBUG_MODE, ESC_THEME, EsAreaChartComponent, EsChartComponent, EsChartsModule, EsLineChartComponent, EsPieChartComponent, EsVertical2DChartComponent, EsVerticalChartComponent, EsVerticalStackedChartComponent, KeyValue, KeyValueColor, LegendPad, Limit, LineChartData, LineChartSettings, LineSerie, PageChartSelector, PagedChartData, PieChartData, PieChartSettings, Vertical2DChartData, Vertical2DChartSettings, VerticalChartData, VerticalChartSettings, VerticalStackedChartData, VerticalStackedChartSettings };
2829
- //# sourceMappingURL=esfaenza-es-charts.mjs.map