@esfaenza/es-charts 15.2.8 → 16.0.2

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 (99) 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/{esm2020 → esm2022}/lib/services/AreaChartService.mjs +156 -156
  40. package/{esm2020 → esm2022}/lib/services/LineChartService.mjs +391 -391
  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 -2728
  49. package/{fesm2020 → fesm2022}/esfaenza-es-charts.mjs.map +1 -1
  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 -32
  89. package/lib/services/LineChartService.d.ts +48 -48
  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/fesm2015/esfaenza-es-charts.mjs +0 -2869
  99. package/fesm2015/esfaenza-es-charts.mjs.map +0 -1
@@ -1,2869 +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: this.fixTimeUnit(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
- fixTimeUnit(tu) {
1384
- if (tu === 0)
1385
- return "millisecond";
1386
- else if (tu === 1)
1387
- return "second";
1388
- else if (tu === 2)
1389
- return "minute";
1390
- else if (tu === 3)
1391
- return "hour";
1392
- else if (tu === 4)
1393
- return "day";
1394
- else if (tu === 5)
1395
- return "week";
1396
- else if (tu === 6)
1397
- return "month";
1398
- else if (tu === 7)
1399
- return "year";
1400
- else
1401
- return tu;
1402
- }
1403
- /** @ignore */
1404
- setSelection(from, to) {
1405
- this.dateAxis.zoomToDates(from, to, true, true);
1406
- }
1407
- /** @ignore */
1408
- refreshData(data) {
1409
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1410
- if (this.singleDataSet) {
1411
- var data = this.generateSingleDataset(dataConverted);
1412
- this.ChartInstance.addData(data);
1413
- return;
1414
- }
1415
- throw "Impossibile aggiornare i dati senza unire il dataset. Si prega di impostare [MergeDatasets] a true";
1416
- }
1417
- /** Partendo da dati divisi per seriue genera un dataset unito con la data come chiave e i vari valori dopo */
1418
- generateSingleDataset(data) {
1419
- let dto = {};
1420
- data.series.forEach((vs, index) => {
1421
- for (let i = 0; i < vs.values.length; i++) {
1422
- var dataitem = vs.values[i];
1423
- var indexer = new Date(dataitem.d).valueOf();
1424
- if (!dto[indexer])
1425
- dto[indexer] = {};
1426
- dto[indexer]['v' + index] = dataitem.v;
1427
- }
1428
- });
1429
- var dates = Object.keys(dto);
1430
- var ret = [];
1431
- for (let i = 0; i < dates.length; i++) {
1432
- let values = dto[dates[i]];
1433
- let item = { d: new Date(parseInt(dates[i])) };
1434
- var vals = Object.keys(values);
1435
- for (let ii = 0; ii < vals.length; ii++) {
1436
- let series = vals[ii];
1437
- let singleVal = values[series];
1438
- item[series] = singleVal;
1439
- }
1440
- ret.push(item);
1441
- }
1442
- return ret;
1443
- }
1444
- /** @ignore */
1445
- emitSelectionChanged(ev, settings) {
1446
- if (settings.OnSelectionChangedCallback) {
1447
- this.throttla("selchange", () => {
1448
- var axis = ev.target;
1449
- var start = new Date(axis.minZoomed);
1450
- var end = new Date(axis.maxZoomed);
1451
- var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
1452
- settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
1453
- }, 150);
1454
- }
1455
- }
1456
- /** @ignore */
1457
- processOver(hoveredSeries) {
1458
- hoveredSeries.zIndex = 999;
1459
- let fill = hoveredSeries.fillOpacity == this.OpacityOnFill;
1460
- hoveredSeries.segments.each((segment) => {
1461
- segment.setState("hover");
1462
- if (!fill)
1463
- segment.fillSprite.fillOpacity = this.OpacityOnSelected;
1464
- });
1465
- if (!fill)
1466
- hoveredSeries.legendDataItem.marker.children.getIndex(1).fillOpacity = this.OpacityOnSelected;
1467
- this.ChartInstance.series.each((series) => {
1468
- if (series != hoveredSeries) {
1469
- let fill = series.fillOpacity == this.OpacityOnFill;
1470
- series.segments.each((segment) => {
1471
- segment.setState("dimmed");
1472
- if (!fill)
1473
- segment.fillSprite.fillOpacity = 0;
1474
- });
1475
- }
1476
- });
1477
- }
1478
- /** @ignore */
1479
- processOut() {
1480
- this.ChartInstance.series.each((series, i) => {
1481
- series.zIndex = i;
1482
- let fill = series.fillOpacity == this.OpacityOnFill;
1483
- series.segments.each((segment) => {
1484
- segment.setState("default");
1485
- if (!fill)
1486
- segment.fillSprite.fillOpacity = 0;
1487
- });
1488
- if (!fill)
1489
- series.legendDataItem.marker.children.getIndex(1).fillOpacity = 0;
1490
- });
1491
- }
1492
- /** @ignore */
1493
- throttla(id, func, throttleTime) {
1494
- //Se ho la funzione che vuole eseguire ripulisco quel timeout
1495
- if (this.executionTimers[id])
1496
- clearTimeout(this.executionTimers[id]);
1497
- //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
1498
- this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
1499
- }
1500
- }
1501
-
1502
- /**
1503
- * Classe il cui unico scopo è gestire il setup e rendering di un PieChart
1504
- */
1505
- class PieChartService {
1506
- /** @ignore */
1507
- constructor(Adapter) {
1508
- this.Adapter = Adapter;
1509
- /** @ignore */
1510
- this.ViewAbsoluteValues = true;
1511
- }
1512
- /**
1513
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un PieChart
1514
- */
1515
- graphicate(data, settings) {
1516
- var _a, _b, _c, _d;
1517
- if (settings.Timeline) {
1518
- console.error("Timeline not supported for pie chart");
1519
- return null;
1520
- }
1521
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1522
- am4core.options.autoDispose = true;
1523
- this.ChartInstance = am4core.create(settings.Name, settings.Mode3D ? am4charts.PieChart3D : am4charts.PieChart);
1524
- this.ChartInstance.innerRadius = ((settings.DonutRadiusPercentage || 15) / 100) * settings.ContainerHeight;
1525
- let series = this.ChartInstance.series.push(settings.Mode3D ? new am4charts.PieSeries3D() : new am4charts.PieSeries());
1526
- series.dataFields.value = "v";
1527
- series.dataFields.category = "k";
1528
- //Il default sono valori percentuali
1529
- if (this.ViewAbsoluteValues) {
1530
- series.legendSettings.valueText = "{value}";
1531
- series.labels.template.text = "{category}: [bold]{value}[/]";
1532
- }
1533
- series.slices.template.stroke = am4core.color("#fff");
1534
- series.slices.template.strokeOpacity = 1;
1535
- series.slices.template.togglable = false;
1536
- series.hiddenState.properties.opacity = 1;
1537
- series.hiddenState.properties.endAngle = -90;
1538
- series.hiddenState.properties.startAngle = -90;
1539
- if (settings.HideZeroes == null ? true : settings.HideZeroes) {
1540
- series.ticks.template.events.on("ready", this.hideZeroes);
1541
- series.ticks.template.events.on("visibilitychanged", this.hideZeroes);
1542
- series.labels.template.events.on("ready", this.hideZeroes);
1543
- series.labels.template.events.on("visibilitychanged", this.hideZeroes);
1544
- }
1545
- series.slices.template.events.on("hit", (ev) => {
1546
- if (settings.OnSeriesClickCallback) {
1547
- let clickedSeries = ev.target.dataItem.dataContext.k;
1548
- settings.OnSeriesClickCallback(clickedSeries);
1549
- }
1550
- });
1551
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForPieChart(data) : data;
1552
- let defaultIndex = 0;
1553
- for (let i = 0; i < dataConverted.values.length; i++) {
1554
- if (!dataConverted.values[i].c) {
1555
- dataConverted.values[i].c = this.ChartInstance.colors.list[defaultIndex % this.ChartInstance.colors.list.length];
1556
- defaultIndex++;
1557
- }
1558
- else
1559
- dataConverted.values[i].c = am4core.color(dataConverted.values[i].c);
1560
- }
1561
- series.slices.template.propertyFields.fill = "c";
1562
- this.ChartInstance.data = dataConverted.values;
1563
- if (!settings.LabelsVisible) {
1564
- series.labels.template.disabled = true;
1565
- series.ticks.template.disabled = true;
1566
- }
1567
- else if (settings.LabelsWrap || settings.LabelsTruncate) {
1568
- series.labels.template.maxWidth = settings.LabelsWidth || 100;
1569
- if (settings.LabelsWrap)
1570
- series.labels.template.wrap = true;
1571
- else if (settings.LabelsTruncate)
1572
- series.labels.template.truncate = true;
1573
- }
1574
- if (settings.Legend) {
1575
- let legend = new am4charts.Legend();
1576
- this.ChartInstance.legend = legend;
1577
- legend.position = (settings === null || settings === void 0 ? void 0 : settings.LegendPosition) || "bottom";
1578
- legend.itemContainers.template.togglable = settings.HideSeriesOnLabelClick === true;
1579
- legend.itemContainers.template.tooltipText = "{category}";
1580
- //Se la legenda non fa il toggle della serie la considero come se fosse un click sulla serie in se
1581
- if (!settings.HideSeriesOnLabelClick) {
1582
- legend.itemContainers.template.events.on("hit", (ev) => {
1583
- if (settings.OnSeriesClickCallback) {
1584
- let clickedSeries = ev.target.dataItem.dataContext.legendDataItem.name;
1585
- settings.OnSeriesClickCallback(clickedSeries);
1586
- }
1587
- });
1588
- }
1589
- if (settings.LegendPadding) {
1590
- let template = this.ChartInstance.legend.itemContainers.template;
1591
- template.paddingTop = (_a = settings.LegendPadding.top) !== null && _a !== void 0 ? _a : 0;
1592
- template.paddingBottom = (_b = settings.LegendPadding.bottom) !== null && _b !== void 0 ? _b : 0;
1593
- template.paddingLeft = (_c = settings.LegendPadding.left) !== null && _c !== void 0 ? _c : 0;
1594
- template.paddingRight = (_d = settings.LegendPadding.right) !== null && _d !== void 0 ? _d : 0;
1595
- }
1596
- }
1597
- return this;
1598
- }
1599
- /** @ignore */
1600
- setSelection(from, to) {
1601
- }
1602
- /** @ignore */
1603
- refreshData(data) {
1604
- //TODO:IMPL
1605
- }
1606
- /** @ignore */
1607
- hideZeroes(ev) {
1608
- if (ev.target.dataItem && (ev.target.dataItem.values.value.percent == 0))
1609
- ev.target.hide();
1610
- else
1611
- ev.target.show();
1612
- }
1613
- }
1614
-
1615
- /**
1616
- * Classe il cui unico scopo è gestire il setup e rendering di un VerticalChart
1617
- */
1618
- class VerticalChartService {
1619
- /** @ignore */
1620
- constructor(Adapter) {
1621
- this.Adapter = Adapter;
1622
- /** @ignore */
1623
- this.dangerZone = 50;
1624
- /** @ignore */
1625
- this.LabelWidth = 150;
1626
- /** @ignore */
1627
- this.LabelRightWhenCompressed = 20;
1628
- /** @ignore */
1629
- this.LabelTopWhenCompressed = -5;
1630
- /** @ignore */
1631
- this.DefaultColumnWidthPercentage = 85;
1632
- }
1633
- /**
1634
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalChart
1635
- */
1636
- graphicate(data, settings) {
1637
- var _a, _b, _c, _d, _e, _f, _g, _h;
1638
- if (settings.Timeline) {
1639
- console.error("Timeline not supported for vertical chart");
1640
- return null;
1641
- }
1642
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1643
- am4core.options.autoDispose = true;
1644
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1645
- let ChartInstanceCasted = this.ChartInstance;
1646
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForVerticalChart(data) : data;
1647
- ChartInstanceCasted.data = dataConverted.values;
1648
- let noStrokes = dataConverted.values.some(t => !!t.c);
1649
- if (settings.Legend) {
1650
- ChartInstanceCasted.legend = new am4charts.Legend();
1651
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1652
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1653
- if (settings.LegendPadding) {
1654
- let template = this.ChartInstance.legend.itemContainers.template;
1655
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1656
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1657
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1658
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1659
- }
1660
- }
1661
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1662
- if (settings.YAxisTitle) {
1663
- yAxis.title.text = settings.YAxisTitle;
1664
- yAxis.title.fontWeight = "bold";
1665
- }
1666
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1667
- if (settings.XAxisTitle) {
1668
- categoryAxis.title.text = settings.XAxisTitle;
1669
- categoryAxis.title.fontWeight = "bold";
1670
- }
1671
- categoryAxis.dataFields.category = "k";
1672
- categoryAxis.renderer.grid.template.location = 0;
1673
- categoryAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 30;
1674
- let label = categoryAxis.renderer.labels.template;
1675
- label.truncate = true;
1676
- label.maxWidth = (_g = settings.LabelWidth) !== null && _g !== void 0 ? _g : this.LabelWidth;
1677
- label.tooltipText = "{category}";
1678
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1679
- categoryAxis.events.on("sizechanged", (ev) => {
1680
- var _a, _b, _c;
1681
- let axis = ev.target;
1682
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1683
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1684
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1685
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1686
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1687
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1688
- axis.renderer.labels.template.horizontalCenter = "right";
1689
- axis.renderer.labels.template.verticalCenter = "middle";
1690
- }
1691
- else {
1692
- axis.renderer.labels.template.rotation = 0;
1693
- axis.renderer.labels.template.dx = 0;
1694
- axis.renderer.labels.template.dy = 0;
1695
- axis.renderer.labels.template.horizontalCenter = "middle";
1696
- axis.renderer.labels.template.verticalCenter = "top";
1697
- }
1698
- });
1699
- }
1700
- // Create series
1701
- let series = ChartInstanceCasted.series.push(new am4charts.ColumnSeries());
1702
- series.dataFields.valueY = "v";
1703
- series.dataFields.categoryX = "k";
1704
- series.name = "";
1705
- let columnTemplate = series.columns.template;
1706
- columnTemplate.tooltipText = "{categoryX}: [bold]{valueY}[/] {t}";
1707
- columnTemplate.fillOpacity = .8;
1708
- columnTemplate.width = am4core.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
1709
- if (noStrokes) {
1710
- columnTemplate.strokeOpacity = 0;
1711
- columnTemplate.strokeWidth = 0;
1712
- columnTemplate.adapter.add("fill", (_, target) => am4core.color(target.dataItem.dataContext.c));
1713
- }
1714
- else {
1715
- columnTemplate.strokeWidth = 2;
1716
- columnTemplate.strokeOpacity = 1;
1717
- }
1718
- return this;
1719
- }
1720
- /** @ignore */
1721
- setSelection(from, to) {
1722
- }
1723
- /** @ignore */
1724
- refreshData(data) {
1725
- //TODO:IMPL
1726
- }
1727
- }
1728
-
1729
- /**
1730
- * Classe il cui unico scopo è gestire il setup e rendering di un Vertical2DChart
1731
- */
1732
- class Vertical2DChartService {
1733
- /** @ignore */
1734
- constructor(Adapter) {
1735
- this.Adapter = Adapter;
1736
- /** @ignore */
1737
- this.DefaultGroupPaddingPercentage = 5;
1738
- /** @ignore */
1739
- this.dangerZone = 50;
1740
- /** @ignore */
1741
- this.LabelWidth = 150;
1742
- /** @ignore */
1743
- this.LabelRightWhenCompressed = 20;
1744
- /** @ignore */
1745
- this.LabelTopWhenCompressed = -5;
1746
- /** @ignore */
1747
- this.DefaultColumnWidthPercentage = 85;
1748
- }
1749
- /**
1750
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un Vertical2DChart
1751
- */
1752
- graphicate(data, settings) {
1753
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1754
- if (settings.Timeline) {
1755
- console.error("Timeline not supported for vertical chart");
1756
- return null;
1757
- }
1758
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1759
- am4core.options.autoDispose = true;
1760
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1761
- let ChartInstanceCasted = this.ChartInstance;
1762
- if (settings.Legend) {
1763
- ChartInstanceCasted.legend = new am4charts.Legend();
1764
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
1765
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1766
- if (settings.LegendPadding) {
1767
- let template = this.ChartInstance.legend.itemContainers.template;
1768
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
1769
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
1770
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
1771
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
1772
- }
1773
- }
1774
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1775
- if (settings.YAxisTitle) {
1776
- yAxis.title.text = settings.YAxisTitle;
1777
- yAxis.title.fontWeight = "bold";
1778
- }
1779
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1780
- if (settings.XAxisTitle) {
1781
- categoryAxis.title.text = settings.XAxisTitle;
1782
- categoryAxis.title.fontWeight = "bold";
1783
- }
1784
- yAxis.min = 0;
1785
- categoryAxis.dataFields.category = 'key';
1786
- categoryAxis.renderer.cellStartLocation = am4core.percent((_f = settings.GroupPaddingPercentage) !== null && _f !== void 0 ? _f : this.DefaultGroupPaddingPercentage).value;
1787
- categoryAxis.renderer.cellEndLocation = am4core.percent(100 - ((_g = settings.GroupPaddingPercentage) !== null && _g !== void 0 ? _g : this.DefaultGroupPaddingPercentage)).value;
1788
- categoryAxis.renderer.grid.template.location = 0;
1789
- categoryAxis.renderer.minGridDistance = (_h = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _h !== void 0 ? _h : 30;
1790
- let label = categoryAxis.renderer.labels.template;
1791
- label.truncate = true;
1792
- label.maxWidth = (_j = settings.LabelWidth) !== null && _j !== void 0 ? _j : this.LabelWidth;
1793
- label.tooltipText = "{category}";
1794
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1795
- categoryAxis.events.on("sizechanged", (ev) => {
1796
- var _a, _b, _c;
1797
- let axis = ev.target;
1798
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1799
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1800
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1801
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1802
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1803
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1804
- axis.renderer.labels.template.horizontalCenter = "right";
1805
- axis.renderer.labels.template.verticalCenter = "middle";
1806
- }
1807
- else {
1808
- axis.renderer.labels.template.rotation = 0;
1809
- axis.renderer.labels.template.dx = 0;
1810
- axis.renderer.labels.template.dy = 0;
1811
- axis.renderer.labels.template.horizontalCenter = "middle";
1812
- axis.renderer.labels.template.verticalCenter = "top";
1813
- }
1814
- });
1815
- }
1816
- let dataPreConverted = this.Adapter ? this.Adapter.adaptDataForVertical2DChart(data) : data;
1817
- let dataConverted = [];
1818
- for (let i = 0; i < dataPreConverted.groups.length; i++) {
1819
- let item = dataPreConverted.groups[i];
1820
- let obj = { key: item.name };
1821
- for (let p = 0; p < item.values.length; p++) {
1822
- let value = item.values[p];
1823
- obj[value.k] = value.v;
1824
- }
1825
- dataConverted.push(obj);
1826
- }
1827
- ChartInstanceCasted.data = dataConverted;
1828
- if (dataPreConverted.colorinfos)
1829
- ChartInstanceCasted.colors.list = dataPreConverted.colorinfos.map(c => am4core.color(c.color));
1830
- //Prendo la prima categoria e mi baso sulle proprietà per dfeinire le serie
1831
- for (let prop in dataConverted[0])
1832
- if (prop !== "key")
1833
- this.createSeries(ChartInstanceCasted, settings, prop, prop);
1834
- return this;
1835
- }
1836
- /** @ignore */
1837
- setSelection(from, to) {
1838
- }
1839
- /** @ignore */
1840
- refreshData(data) {
1841
- //TODO:IMPL
1842
- }
1843
- /** @ignore */
1844
- createSeries(chart, settings, value, name) {
1845
- var _a;
1846
- let series = chart.series.push(new am4charts.ColumnSeries());
1847
- series.dataFields.valueY = value;
1848
- series.dataFields.categoryX = 'key';
1849
- series.name = name;
1850
- series.columns.template.tooltipText = "{name} {categoryX}: [bold]{valueY}[/]";
1851
- series.columns.template.fillOpacity = .8;
1852
- series.columns.template.width = am4core.percent((_a = settings.ColumnWidthPercentage) !== null && _a !== void 0 ? _a : this.DefaultColumnWidthPercentage);
1853
- series.events.on("hidden", () => this.arrangeColumns);
1854
- series.events.on("shown", () => this.arrangeColumns);
1855
- return series;
1856
- }
1857
- /** @ignore */
1858
- arrangeColumns() {
1859
- let ChartInstanceCasted = this.ChartInstance;
1860
- let series = ChartInstanceCasted.series.getIndex(0);
1861
- let xAxis = ChartInstanceCasted.xAxes.getIndex(0);
1862
- let w = 1 - xAxis.renderer.cellStartLocation - (1 - xAxis.renderer.cellEndLocation);
1863
- if (series.dataItems.length > 1) {
1864
- let x0 = xAxis.getX(series.dataItems.getIndex(0), "categoryX");
1865
- let x1 = xAxis.getX(series.dataItems.getIndex(1), "categoryX");
1866
- let delta = ((x1 - x0) / ChartInstanceCasted.series.length) * w;
1867
- if (am4core.isNumber(delta)) {
1868
- let middle = ChartInstanceCasted.series.length / 2;
1869
- let newIndex = 0;
1870
- ChartInstanceCasted.series.each((series) => {
1871
- if (!series.isHidden && !series.isHiding) {
1872
- series.dummyData = newIndex;
1873
- newIndex++;
1874
- }
1875
- else {
1876
- series.dummyData = ChartInstanceCasted.series.indexOf(series);
1877
- }
1878
- });
1879
- let visibleCount = newIndex;
1880
- let newMiddle = visibleCount / 2;
1881
- ChartInstanceCasted.series.each((series) => {
1882
- let trueIndex = ChartInstanceCasted.series.indexOf(series);
1883
- let newIndex = series.dummyData;
1884
- let dx = (newIndex - trueIndex + middle - newMiddle) * delta;
1885
- series.animate({ property: "dx", to: dx }, series.interpolationDuration, series.interpolationEasing);
1886
- series.bulletsContainer.animate({ property: "dx", to: dx }, series.interpolationDuration, series.interpolationEasing);
1887
- });
1888
- }
1889
- }
1890
- }
1891
- }
1892
-
1893
- /**
1894
- * Classe il cui unico scopo è gestire il setup e rendering di un VerticalStackedChart
1895
- */
1896
- class VerticalStackedChartService {
1897
- /** @ignore */
1898
- constructor(Adapter) {
1899
- this.Adapter = Adapter;
1900
- /** @ignore */
1901
- this.dangerZone = 50;
1902
- /** @ignore */
1903
- this.LabelWidth = 150;
1904
- /** @ignore */
1905
- this.LabelRightWhenCompressed = 20;
1906
- /** @ignore */
1907
- this.LabelTopWhenCompressed = -5;
1908
- /** @ignore */
1909
- this.DefaultColumnWidthPercentage = 85;
1910
- }
1911
- /**
1912
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un VerticalStackedChart
1913
- */
1914
- graphicate(data, settings) {
1915
- var _a, _b, _c, _d, _e, _f, _g;
1916
- if (settings.Timeline) {
1917
- console.error("Timeline not supported for vertical chart");
1918
- return null;
1919
- }
1920
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
1921
- am4core.options.autoDispose = true;
1922
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
1923
- let ChartInstanceCasted = this.ChartInstance;
1924
- // Create axes
1925
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
1926
- if (settings.YAxisTitle) {
1927
- yAxis.title.text = settings.YAxisTitle;
1928
- yAxis.title.fontWeight = "bold";
1929
- }
1930
- let categoryAxis = ChartInstanceCasted.xAxes.push(new am4charts.CategoryAxis());
1931
- if (settings.XAxisTitle) {
1932
- categoryAxis.title.text = settings.XAxisTitle;
1933
- categoryAxis.title.fontWeight = "bold";
1934
- }
1935
- yAxis.min = 0;
1936
- categoryAxis.dataFields.category = "key";
1937
- categoryAxis.renderer.grid.template.location = 0;
1938
- categoryAxis.renderer.minGridDistance = (_a = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _a !== void 0 ? _a : 30;
1939
- let label = categoryAxis.renderer.labels.template;
1940
- label.truncate = true;
1941
- label.maxWidth = (_b = settings.LabelWidth) !== null && _b !== void 0 ? _b : this.LabelWidth;
1942
- label.tooltipText = "{category}";
1943
- if ((settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) == null ? true : settings === null || settings === void 0 ? void 0 : settings.AdaptLabelSizeAndOrientation) {
1944
- categoryAxis.events.on("sizechanged", (ev) => {
1945
- var _a, _b, _c;
1946
- let axis = ev.target;
1947
- var cellWidth = axis.pixelWidth / (axis.endIndex - axis.startIndex);
1948
- if (cellWidth < axis.renderer.labels.template.maxWidth) {
1949
- let areWeInDangerZone = cellWidth < ((_a = settings === null || settings === void 0 ? void 0 : settings.LabelVerticalOrientationCutoffWidth) !== null && _a !== void 0 ? _a : this.dangerZone);
1950
- axis.renderer.labels.template.rotation = areWeInDangerZone ? -90 : -45;
1951
- axis.renderer.labels.template.dx = ((_b = settings.LabelRightWhenCompressed) !== null && _b !== void 0 ? _b : areWeInDangerZone) ? 0 : this.LabelRightWhenCompressed;
1952
- axis.renderer.labels.template.dy = (_c = settings.LabelTopWhenCompressed) !== null && _c !== void 0 ? _c : this.LabelTopWhenCompressed;
1953
- axis.renderer.labels.template.horizontalCenter = "right";
1954
- axis.renderer.labels.template.verticalCenter = "middle";
1955
- }
1956
- else {
1957
- axis.renderer.labels.template.rotation = 0;
1958
- axis.renderer.labels.template.dx = 0;
1959
- axis.renderer.labels.template.dy = 0;
1960
- axis.renderer.labels.template.horizontalCenter = "middle";
1961
- axis.renderer.labels.template.verticalCenter = "top";
1962
- }
1963
- });
1964
- }
1965
- let dataPreConverted = this.Adapter ? this.Adapter.adaptDataForVerticalStackedChart(data) : data;
1966
- let dataConverted = [];
1967
- for (let i = 0; i < dataPreConverted.groups.length; i++) {
1968
- let item = dataPreConverted.groups[i];
1969
- let obj = { key: item.name };
1970
- for (let p = 0; p < item.values.length; p++) {
1971
- let value = item.values[p];
1972
- obj[value.k] = value.v;
1973
- }
1974
- dataConverted.push(obj);
1975
- }
1976
- ChartInstanceCasted.data = dataConverted;
1977
- //Prendo la prima categoria e mi baso sulle proprietà per dfeinire le serie
1978
- for (let prop in dataConverted[0]) {
1979
- if (prop !== "key")
1980
- this.createSeriesStacked(ChartInstanceCasted, settings, prop, prop);
1981
- }
1982
- if (settings.Legend) {
1983
- ChartInstanceCasted.legend = new am4charts.Legend();
1984
- ChartInstanceCasted.legend.position = (_c = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _c !== void 0 ? _c : 'right';
1985
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
1986
- if (settings.LegendPadding) {
1987
- let template = this.ChartInstance.legend.itemContainers.template;
1988
- template.paddingTop = (_d = settings.LegendPadding.top) !== null && _d !== void 0 ? _d : 0;
1989
- template.paddingBottom = (_e = settings.LegendPadding.bottom) !== null && _e !== void 0 ? _e : 0;
1990
- template.paddingLeft = (_f = settings.LegendPadding.left) !== null && _f !== void 0 ? _f : 0;
1991
- template.paddingRight = (_g = settings.LegendPadding.right) !== null && _g !== void 0 ? _g : 0;
1992
- }
1993
- }
1994
- return this;
1995
- }
1996
- /** @ignore */
1997
- setSelection(from, to) {
1998
- }
1999
- /** @ignore */
2000
- refreshData(data) {
2001
- //TODO:IMPL
2002
- }
2003
- /** @ignore */
2004
- createSeriesStacked(chart, settings, field, name) {
2005
- var _a;
2006
- // Set up series
2007
- let series = chart.series.push(new am4charts.ColumnSeries());
2008
- series.name = name;
2009
- series.dataFields.valueY = field;
2010
- series.dataFields.categoryX = "key";
2011
- series.sequencedInterpolation = true;
2012
- series.columns.template.tooltipText = "{name} {categoryX}: [bold]{valueY}[/]";
2013
- series.columns.template.fillOpacity = .8;
2014
- series.columns.template.width = am4core.percent((_a = settings.ColumnWidthPercentage) !== null && _a !== void 0 ? _a : this.DefaultColumnWidthPercentage);
2015
- // Make it stacked
2016
- series.stacked = true;
2017
- return series;
2018
- }
2019
- }
2020
-
2021
- /**
2022
- * Classe il cui unico scopo è gestire il setup e rendering di un AreaChart
2023
- */
2024
- class AreaChartService {
2025
- /** @ignore */
2026
- constructor(Adapter) {
2027
- this.Adapter = Adapter;
2028
- //******************** Funzione di throttling per non spammare richieste in caso di animazioni attivate
2029
- //TODO: spostarla in un metodo di utilità (esfaenza/extensions)
2030
- /** @ignore */
2031
- this.executionTimers = {};
2032
- }
2033
- /**
2034
- * Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un AreaChart
2035
- */
2036
- graphicate(data, settings) {
2037
- var _a, _b, _c, _d, _e, _f;
2038
- if (settings.Timeline) {
2039
- console.error("Timeline not supported for area chart");
2040
- return null;
2041
- }
2042
- let dataConverted = this.Adapter ? this.Adapter.adaptDataForAreaChart(data) : data;
2043
- let showTicks = settings.ShowTicks == null ? true : settings === null || settings === void 0 ? void 0 : settings.ShowTicks;
2044
- let interval = dataConverted.interval;
2045
- //Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
2046
- am4core.options.autoDispose = true;
2047
- this.ChartInstance = am4core.create(settings.Name, am4charts.XYChart);
2048
- let ChartInstanceCasted = this.ChartInstance;
2049
- if (settings.Legend) {
2050
- ChartInstanceCasted.legend = new am4charts.Legend();
2051
- ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
2052
- ChartInstanceCasted.legend.itemContainers.template.tooltipText = "{category}";
2053
- if (settings.LegendPadding) {
2054
- let template = this.ChartInstance.legend.itemContainers.template;
2055
- template.paddingTop = (_b = settings.LegendPadding.top) !== null && _b !== void 0 ? _b : 0;
2056
- template.paddingBottom = (_c = settings.LegendPadding.bottom) !== null && _c !== void 0 ? _c : 0;
2057
- template.paddingLeft = (_d = settings.LegendPadding.left) !== null && _d !== void 0 ? _d : 0;
2058
- template.paddingRight = (_e = settings.LegendPadding.right) !== null && _e !== void 0 ? _e : 0;
2059
- }
2060
- }
2061
- let yAxis = ChartInstanceCasted.yAxes.push(new am4charts.ValueAxis());
2062
- yAxis.tooltip.disabled = true;
2063
- if (settings.YAxisTitle) {
2064
- yAxis.title.text = settings.YAxisTitle;
2065
- yAxis.title.fontWeight = "bold";
2066
- }
2067
- yAxis.min = 0;
2068
- let dateAxis = ChartInstanceCasted.xAxes.push(new am4charts.DateAxis());
2069
- dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
2070
- dateAxis.startLocation = 0.5;
2071
- dateAxis.endLocation = 0.5;
2072
- if (settings.XAxisTitle) {
2073
- dateAxis.title.text = settings.XAxisTitle;
2074
- dateAxis.title.fontWeight = "bold";
2075
- }
2076
- if (showTicks) {
2077
- dateAxis.renderer.ticks.template.disabled = false;
2078
- dateAxis.renderer.ticks.template.strokeOpacity = 1;
2079
- dateAxis.renderer.ticks.template.stroke = am4core.color("#495C43");
2080
- dateAxis.renderer.ticks.template.strokeWidth = 2;
2081
- dateAxis.renderer.ticks.template.length = 10;
2082
- dateAxis.renderer.ticks.template.location = 0;
2083
- }
2084
- if (!!interval)
2085
- dateAxis.baseInterval = { count: interval.count, timeUnit: this.fixTimeUnit(interval.timeunit) };
2086
- // Unisco il dataset e tiro fuori i dati
2087
- let chartData = [];
2088
- let seriesToMakeCache = {};
2089
- let seriesToMake = [];
2090
- for (let i = 0; i < dataConverted.groups.length; i++) {
2091
- let group = dataConverted.groups[i];
2092
- let dataItem = { date: group.name };
2093
- for (let ii = 0; ii < group.values.length; ii++) {
2094
- let val = group.values[ii];
2095
- dataItem[val.k] = val.v;
2096
- if (!seriesToMakeCache[val.k]) {
2097
- seriesToMakeCache[val.k] = true;
2098
- seriesToMake.push(val.k);
2099
- }
2100
- }
2101
- chartData.push(dataItem);
2102
- }
2103
- ChartInstanceCasted.data = chartData;
2104
- //---------------------------------------------------------
2105
- seriesToMake.forEach(s => { this.createSeries(ChartInstanceCasted, s); });
2106
- ChartInstanceCasted.cursor = new am4charts.XYCursor();
2107
- ChartInstanceCasted.cursor.xAxis = dateAxis;
2108
- dateAxis.events.on("startchanged", t => this.emitSelectionChanged(t, settings));
2109
- dateAxis.events.on("endchanged", t => this.emitSelectionChanged(t, settings));
2110
- return this;
2111
- }
2112
- fixTimeUnit(tu) {
2113
- if (tu === 0)
2114
- return "millisecond";
2115
- else if (tu === 1)
2116
- return "second";
2117
- else if (tu === 2)
2118
- return "minute";
2119
- else if (tu === 3)
2120
- return "hour";
2121
- else if (tu === 4)
2122
- return "day";
2123
- else if (tu === 5)
2124
- return "week";
2125
- else if (tu === 6)
2126
- return "month";
2127
- else if (tu === 7)
2128
- return "year";
2129
- else
2130
- return tu;
2131
- }
2132
- /** @ignore */
2133
- setSelection(from, to) {
2134
- }
2135
- /** @ignore */
2136
- refreshData(data) {
2137
- //TODO:IMPL
2138
- }
2139
- /** @ignore */
2140
- emitSelectionChanged(ev, settings) {
2141
- if (settings.OnSelectionChangedCallback) {
2142
- this.throttla("selchange", () => {
2143
- var axis = ev.target;
2144
- var start = new Date(axis.minZoomed);
2145
- var end = new Date(axis.maxZoomed);
2146
- var initial = axis.min == axis.minZoomed && axis.max == axis.maxZoomed;
2147
- settings.OnSelectionChangedCallback({ from: start, to: end, initial: initial });
2148
- }, 150);
2149
- }
2150
- }
2151
- /** @ignore */
2152
- createSeries(chart, name) {
2153
- let series = chart.series.push(new am4charts.LineSeries());
2154
- series.dataFields.dateX = "date";
2155
- series.name = name[0].toUpperCase() + name.slice(1);
2156
- series.dataFields.valueY = name;
2157
- series.tooltipText = "[#000]{valueY.value}[/]";
2158
- //series.tooltip.background.fill = am4core.color("#FFF");
2159
- series.tooltip.getStrokeFromObject = true;
2160
- series.tooltip.background.strokeWidth = 3;
2161
- series.tooltip.getFillFromObject = false;
2162
- series.fillOpacity = 0.6;
2163
- series.strokeWidth = 2;
2164
- series.stacked = true;
2165
- return series;
2166
- }
2167
- /** @ignore */
2168
- throttla(id, func, throttleTime) {
2169
- //Se ho la funzione che vuole eseguire ripulisco quel timeout
2170
- if (this.executionTimers[id])
2171
- clearTimeout(this.executionTimers[id]);
2172
- //Ricreo il timeout per eseguire quella funzione dopo throttleTime millisecondi
2173
- this.executionTimers[id] = setTimeout(() => { func(); this.executionTimers[id] = null; }, throttleTime);
2174
- }
2175
- }
2176
-
2177
- /**
2178
- * Componente specifico per la graficazione di un qualsiasi tipo di grafico.
2179
- *
2180
- * Si basa sul tipo specificato dalla proprietà **Type**
2181
- */
2182
- class EsChartComponent extends BaseChartComponent {
2183
- /**
2184
- * @ignore
2185
- */
2186
- constructor(el, ChartLoader, ChartDispatcher, dateService, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2187
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2188
- this.dateService = dateService;
2189
- this.adapter = adapter;
2190
- }
2191
- /**
2192
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2193
- */
2194
- getSpecificPropertiesToCheck() {
2195
- return ["Data", "Type"];
2196
- }
2197
- /**
2198
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2199
- *
2200
- * @returns {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} Settings castati al tipo giusto
2201
- */
2202
- getCastedSettings() {
2203
- var _a, _b, _c, _d, _e, _f;
2204
- switch (this.Type) {
2205
- case 'pie':
2206
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new PieChartSettings());
2207
- case 'area':
2208
- return ((_b = this.Settings) !== null && _b !== void 0 ? _b : new AreaChartSettings());
2209
- case 'line':
2210
- return ((_c = this.Settings) !== null && _c !== void 0 ? _c : new LineChartSettings());
2211
- case 'vertical':
2212
- return ((_d = this.Settings) !== null && _d !== void 0 ? _d : new VerticalChartSettings());
2213
- case 'vertical-2d':
2214
- return ((_e = this.Settings) !== null && _e !== void 0 ? _e : new Vertical2DChartSettings());
2215
- case 'vertical-stacked':
2216
- return ((_f = this.Settings) !== null && _f !== void 0 ? _f : new VerticalStackedChartSettings());
2217
- }
2218
- }
2219
- /**
2220
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2221
- *
2222
- * @param {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} settingsCasted Settings castati al tipo giusto
2223
- */
2224
- fillSpecificSettings(settingsCasted) {
2225
- // Nope. Se si usa l'es-chart si danno i settings con l'oggetto
2226
- }
2227
- /**
2228
- * Effettua il rendering di questo grafico in base ai Settings
2229
- *
2230
- * @param {PieChartSettings | AreaChartSettings | LineChartSettings | VerticalChartSettings | Vertical2DChartSettings | VerticalStackedChartSettings} settingsCasted Impostazioni di graficazione
2231
- * @returns {PieChartService | AreaChartService | LineChartService | VerticalChartService | Vertical2DChartService | VerticalStackedChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2232
- */
2233
- graphicate(settings) {
2234
- switch (this.Type) {
2235
- case 'pie':
2236
- return new PieChartService(this.adapter).graphicate(this.Data, settings);
2237
- case 'area':
2238
- return new AreaChartService(this.adapter).graphicate(this.Data, settings);
2239
- case 'line':
2240
- return new LineChartService(this.adapter, this.dateService).graphicate(this.Data, settings);
2241
- case 'vertical':
2242
- return new VerticalChartService(this.adapter).graphicate(this.Data, settings);
2243
- case 'vertical-2d':
2244
- return new Vertical2DChartService(this.adapter).graphicate(this.Data, settings);
2245
- case 'vertical-stacked':
2246
- return new VerticalStackedChartService(this.adapter).graphicate(this.Data, settings);
2247
- }
2248
- }
2249
- }
2250
- 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 });
2251
- 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 });
2252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartComponent, decorators: [{
2253
- type: Component,
2254
- 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"] }]
2255
- }], ctorParameters: function () {
2256
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: i3.DateService }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2257
- type: Inject,
2258
- args: [PLATFORM_ID]
2259
- }] }, { type: undefined, decorators: [{
2260
- type: Inject,
2261
- args: [ESC_DEBUG_MODE]
2262
- }] }, { type: undefined, decorators: [{
2263
- type: Inject,
2264
- args: [ESC_ANIMATIONS]
2265
- }] }, { type: undefined, decorators: [{
2266
- type: Inject,
2267
- args: [ESC_THEME]
2268
- }] }, { type: i4.LocalizationService }];
2269
- }, propDecorators: { Type: [{
2270
- type: Input
2271
- }], Data: [{
2272
- type: Input
2273
- }], DataArray: [{
2274
- type: Input
2275
- }] } });
2276
-
2277
- /**
2278
- * Componente specifico per la graficazione di un grafico ad Area
2279
- */
2280
- class EsAreaChartComponent extends BaseChartComponent {
2281
- /**
2282
- * @ignore
2283
- */
2284
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2285
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2286
- this.adapter = adapter;
2287
- }
2288
- /**
2289
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2290
- */
2291
- getSpecificPropertiesToCheck() {
2292
- return ["Data", "DataArray"];
2293
- }
2294
- /**
2295
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2296
- *
2297
- * @returns {AreaChartSettings} Settings castati al tipo giusto
2298
- */
2299
- getCastedSettings() {
2300
- var _a;
2301
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new AreaChartSettings());
2302
- }
2303
- /**
2304
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2305
- *
2306
- * @param {AreaChartSettings} settingsCasted Settings castati al tipo giusto
2307
- */
2308
- fillSpecificSettings(settingsCasted) {
2309
- }
2310
- /**
2311
- * Effettua il rendering di questo grafico in base ai Settings
2312
- *
2313
- * @param {AreaChartSettings} settingsCasted Impostazioni di graficazione
2314
- * @returns {AreaChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2315
- */
2316
- graphicate(settingsCasted) {
2317
- return new AreaChartService(this.adapter).graphicate(this.Data, settingsCasted);
2318
- }
2319
- }
2320
- 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 });
2321
- 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 });
2322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsAreaChartComponent, decorators: [{
2323
- type: Component,
2324
- 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"] }]
2325
- }], ctorParameters: function () {
2326
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2327
- type: Inject,
2328
- args: [PLATFORM_ID]
2329
- }] }, { type: undefined, decorators: [{
2330
- type: Inject,
2331
- args: [ESC_DEBUG_MODE]
2332
- }] }, { type: undefined, decorators: [{
2333
- type: Inject,
2334
- args: [ESC_ANIMATIONS]
2335
- }] }, { type: undefined, decorators: [{
2336
- type: Inject,
2337
- args: [ESC_THEME]
2338
- }] }, { type: i4.LocalizationService }];
2339
- }, propDecorators: { Data: [{
2340
- type: Input
2341
- }], DataArray: [{
2342
- type: Input
2343
- }] } });
2344
-
2345
- /**
2346
- * Componente specifico per la graficazione di un grafico a Linea su un asse temporale
2347
- */
2348
- class EsLineChartComponent extends BaseChartComponent {
2349
- /**
2350
- * @ignore
2351
- */
2352
- constructor(el, ChartLoader, ChartDispatcher, adapter, dateService, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2353
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2354
- this.adapter = adapter;
2355
- this.dateService = dateService;
2356
- }
2357
- /**
2358
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2359
- */
2360
- getSpecificPropertiesToCheck() {
2361
- return ["Data", "DataArray", "Step", "DataGroupBucketSize", "DataGroupingThreshold", "StrokeSize", "Stacked", "AllowGaps", "MergeDatasets", "FinalInstants", "Fill", "Min", "Max"];
2362
- }
2363
- /**
2364
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2365
- *
2366
- * @returns {LineChartSettings} Settings castati al tipo giusto
2367
- */
2368
- getCastedSettings() {
2369
- var _a;
2370
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new LineChartSettings());
2371
- }
2372
- /**
2373
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2374
- *
2375
- * @param {LineChartSettings} settingsCasted Settings castati al tipo giusto
2376
- */
2377
- fillSpecificSettings(settingsCasted) {
2378
- settingsCasted.Step = settingsCasted.Step != null ? settingsCasted.Step : this.Step;
2379
- settingsCasted.DataGroupBucketSize = settingsCasted.DataGroupBucketSize != null ? settingsCasted.DataGroupBucketSize : this.DataGroupBucketSize;
2380
- settingsCasted.StrokeSize = settingsCasted.StrokeSize != null ? settingsCasted.StrokeSize : this.StrokeSize;
2381
- settingsCasted.DataGroupingThreshold = settingsCasted.DataGroupingThreshold != null ? settingsCasted.DataGroupingThreshold : this.DataGroupingThreshold;
2382
- settingsCasted.AllowGaps = settingsCasted.AllowGaps != null ? settingsCasted.AllowGaps : this.AllowGaps;
2383
- settingsCasted.MergeDatasets = settingsCasted.MergeDatasets != null ? settingsCasted.MergeDatasets : this.MergeDatasets;
2384
- settingsCasted.FinalInstants = settingsCasted.FinalInstants != null ? settingsCasted.FinalInstants : this.FinalInstants;
2385
- settingsCasted.Min = settingsCasted.Min != null ? settingsCasted.Min : this.Min;
2386
- settingsCasted.Max = settingsCasted.Max != null ? settingsCasted.Max : this.Max;
2387
- settingsCasted.Fill = settingsCasted.Fill != null ? settingsCasted.Fill : this.Fill;
2388
- settingsCasted.Stacked = settingsCasted.Stacked != null ? settingsCasted.Stacked : this.Stacked;
2389
- }
2390
- /**
2391
- * Effettua il rendering di questo grafico in base ai Settings
2392
- *
2393
- * @param {LineChartSettings} settingsCasted Impostazioni di graficazione
2394
- * @returns {LineChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2395
- */
2396
- graphicate(settingsCasted) {
2397
- return new LineChartService(this.adapter, this.dateService).graphicate(this.Data, settingsCasted);
2398
- }
2399
- }
2400
- 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 });
2401
- 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 });
2402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsLineChartComponent, decorators: [{
2403
- type: Component,
2404
- 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"] }]
2405
- }], ctorParameters: function () {
2406
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i3.DateService }, { type: i0.NgZone }, { type: Object, decorators: [{
2407
- type: Inject,
2408
- args: [PLATFORM_ID]
2409
- }] }, { type: undefined, decorators: [{
2410
- type: Inject,
2411
- args: [ESC_DEBUG_MODE]
2412
- }] }, { type: undefined, decorators: [{
2413
- type: Inject,
2414
- args: [ESC_ANIMATIONS]
2415
- }] }, { type: undefined, decorators: [{
2416
- type: Inject,
2417
- args: [ESC_THEME]
2418
- }] }, { type: i4.LocalizationService }];
2419
- }, propDecorators: { Data: [{
2420
- type: Input
2421
- }], DataArray: [{
2422
- type: Input
2423
- }], Step: [{
2424
- type: Input
2425
- }], DataGroupBucketSize: [{
2426
- type: Input
2427
- }], DataGroupingThreshold: [{
2428
- type: Input
2429
- }], StrokeSize: [{
2430
- type: Input
2431
- }], AllowGaps: [{
2432
- type: Input
2433
- }], MergeDatasets: [{
2434
- type: Input
2435
- }], FinalInstants: [{
2436
- type: Input
2437
- }], Min: [{
2438
- type: Input
2439
- }], Max: [{
2440
- type: Input
2441
- }], Fill: [{
2442
- type: Input
2443
- }], Stacked: [{
2444
- type: Input
2445
- }] } });
2446
-
2447
- /**
2448
- * Componente specifico per la graficazione di un grafico a Torta
2449
- */
2450
- class EsPieChartComponent extends BaseChartComponent {
2451
- /**
2452
- * @ignore
2453
- */
2454
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2455
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2456
- this.adapter = adapter;
2457
- }
2458
- /**
2459
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2460
- */
2461
- getSpecificPropertiesToCheck() {
2462
- return ["Data", "DataArray", "HideZeroes", "Mode3D", "LabelsWrap", "LabelsTruncate", "LabelsWidth", "LabelsVisible"];
2463
- }
2464
- /**
2465
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2466
- *
2467
- * @returns {PieChartSettings} Settings castati al tipo giusto
2468
- */
2469
- getCastedSettings() {
2470
- var _a;
2471
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new PieChartSettings());
2472
- }
2473
- /**
2474
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2475
- *
2476
- * @param {PieChartSettings} settingsCasted Settings castati al tipo giusto
2477
- */
2478
- fillSpecificSettings(settingsCasted) {
2479
- settingsCasted.HideZeroes = settingsCasted.HideZeroes != null ? settingsCasted.HideZeroes : this.HideZeroes;
2480
- settingsCasted.Mode3D = settingsCasted.Mode3D != null ? settingsCasted.Mode3D : this.Mode3D;
2481
- settingsCasted.DonutRadiusPercentage = settingsCasted.DonutRadiusPercentage != null ? settingsCasted.DonutRadiusPercentage : this.DonutRadiusPercentage;
2482
- settingsCasted.LabelsWrap = settingsCasted.LabelsWrap != null ? settingsCasted.LabelsWrap : this.LabelsWrap;
2483
- settingsCasted.LabelsTruncate = settingsCasted.LabelsTruncate != null ? settingsCasted.LabelsTruncate : this.LabelsTruncate;
2484
- settingsCasted.LabelsWidth = settingsCasted.LabelsWidth != null ? settingsCasted.LabelsWidth : this.LabelsWidth;
2485
- settingsCasted.LabelsVisible = settingsCasted.LabelsVisible != null ? settingsCasted.LabelsVisible : this.LabelsVisible;
2486
- }
2487
- /**
2488
- * Effettua il rendering di questo grafico in base ai Settings
2489
- *
2490
- * @param {PieChartSettings} settingsCasted Impostazioni di graficazione
2491
- * @returns {PieChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2492
- */
2493
- graphicate(settingsCasted) {
2494
- return new PieChartService(this.adapter).graphicate(this.Data, settingsCasted);
2495
- }
2496
- }
2497
- 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 });
2498
- 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 });
2499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsPieChartComponent, decorators: [{
2500
- type: Component,
2501
- 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"] }]
2502
- }], ctorParameters: function () {
2503
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2504
- type: Inject,
2505
- args: [PLATFORM_ID]
2506
- }] }, { type: undefined, decorators: [{
2507
- type: Inject,
2508
- args: [ESC_DEBUG_MODE]
2509
- }] }, { type: undefined, decorators: [{
2510
- type: Inject,
2511
- args: [ESC_ANIMATIONS]
2512
- }] }, { type: undefined, decorators: [{
2513
- type: Inject,
2514
- args: [ESC_THEME]
2515
- }] }, { type: i4.LocalizationService }];
2516
- }, propDecorators: { Data: [{
2517
- type: Input
2518
- }], DataArray: [{
2519
- type: Input
2520
- }], HideZeroes: [{
2521
- type: Input
2522
- }], Mode3D: [{
2523
- type: Input
2524
- }], DonutRadiusPercentage: [{
2525
- type: Input
2526
- }], LabelsWrap: [{
2527
- type: Input
2528
- }], LabelsTruncate: [{
2529
- type: Input
2530
- }], LabelsWidth: [{
2531
- type: Input
2532
- }], LabelsVisible: [{
2533
- type: Input
2534
- }] } });
2535
-
2536
- /**
2537
- * Componente specifico per la graficazione di un grafico a Barre con due dimensioni
2538
- */
2539
- class EsVertical2DChartComponent extends BaseChartComponent {
2540
- /**
2541
- * @ignore
2542
- */
2543
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2544
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2545
- this.adapter = adapter;
2546
- }
2547
- /**
2548
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2549
- */
2550
- getSpecificPropertiesToCheck() {
2551
- return ["Data", "DataArray"];
2552
- }
2553
- /**
2554
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2555
- *
2556
- * @returns {Vertical2DChartSettings} Settings castati al tipo giusto
2557
- */
2558
- getCastedSettings() {
2559
- var _a;
2560
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new Vertical2DChartSettings());
2561
- }
2562
- /**
2563
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2564
- *
2565
- * @param {Vertical2DChartSettings} settingsCasted Settings castati al tipo giusto
2566
- */
2567
- fillSpecificSettings(settingsCasted) {
2568
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2569
- settingsCasted.GroupPaddingPercentage = settingsCasted.GroupPaddingPercentage != null ? settingsCasted.GroupPaddingPercentage : this.GroupPaddingPercentage;
2570
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2571
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2572
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2573
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2574
- }
2575
- /**
2576
- * Effettua il rendering di questo grafico in base ai Settings
2577
- *
2578
- * @param {Vertical2DChartSettings} settingsCasted Impostazioni di graficazione
2579
- * @returns {Vertical2DChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2580
- */
2581
- graphicate(settingsCasted) {
2582
- return new Vertical2DChartService(this.adapter).graphicate(this.Data, settingsCasted);
2583
- }
2584
- }
2585
- 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 });
2586
- 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 });
2587
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVertical2DChartComponent, decorators: [{
2588
- type: Component,
2589
- 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"] }]
2590
- }], ctorParameters: function () {
2591
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2592
- type: Inject,
2593
- args: [PLATFORM_ID]
2594
- }] }, { type: undefined, decorators: [{
2595
- type: Inject,
2596
- args: [ESC_DEBUG_MODE]
2597
- }] }, { type: undefined, decorators: [{
2598
- type: Inject,
2599
- args: [ESC_ANIMATIONS]
2600
- }] }, { type: undefined, decorators: [{
2601
- type: Inject,
2602
- args: [ESC_THEME]
2603
- }] }, { type: i4.LocalizationService }];
2604
- }, propDecorators: { Data: [{
2605
- type: Input
2606
- }], DataArray: [{
2607
- type: Input
2608
- }], ColumnWidthPercentage: [{
2609
- type: Input
2610
- }], GroupPaddingPercentage: [{
2611
- type: Input
2612
- }], LabelWidth: [{
2613
- type: Input
2614
- }], LabelVerticalOrientationCutoffWidth: [{
2615
- type: Input
2616
- }], LabelRightWhenCompressed: [{
2617
- type: Input
2618
- }], LabelTopWhenCompressed: [{
2619
- type: Input
2620
- }] } });
2621
-
2622
- /**
2623
- * Componente specifico per la graficazione di un grafico a Barre
2624
- */
2625
- class EsVerticalChartComponent extends BaseChartComponent {
2626
- /**
2627
- * @ignore
2628
- */
2629
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2630
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2631
- this.adapter = adapter;
2632
- }
2633
- /**
2634
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2635
- */
2636
- getSpecificPropertiesToCheck() {
2637
- return ["Data", "DataArray"];
2638
- }
2639
- /**
2640
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2641
- *
2642
- * @returns {VerticalChartSettings} Settings castati al tipo giusto
2643
- */
2644
- getCastedSettings() {
2645
- var _a;
2646
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new VerticalChartSettings());
2647
- }
2648
- /**
2649
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2650
- *
2651
- * @param {VerticalChartSettings} settingsCasted Settings castati al tipo giusto
2652
- */
2653
- fillSpecificSettings(settingsCasted) {
2654
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2655
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2656
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2657
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2658
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2659
- }
2660
- /**
2661
- * Effettua il rendering di questo grafico in base ai Settings
2662
- *
2663
- * @param {VerticalChartSettings} settingsCasted Impostazioni di graficazione
2664
- * @returns {VerticalChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2665
- */
2666
- graphicate(settingsCasted) {
2667
- return new VerticalChartService(this.adapter).graphicate(this.Data, settingsCasted);
2668
- }
2669
- }
2670
- 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 });
2671
- 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 });
2672
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalChartComponent, decorators: [{
2673
- type: Component,
2674
- 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"] }]
2675
- }], ctorParameters: function () {
2676
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2677
- type: Inject,
2678
- args: [PLATFORM_ID]
2679
- }] }, { type: undefined, decorators: [{
2680
- type: Inject,
2681
- args: [ESC_DEBUG_MODE]
2682
- }] }, { type: undefined, decorators: [{
2683
- type: Inject,
2684
- args: [ESC_ANIMATIONS]
2685
- }] }, { type: undefined, decorators: [{
2686
- type: Inject,
2687
- args: [ESC_THEME]
2688
- }] }, { type: i4.LocalizationService }];
2689
- }, propDecorators: { Data: [{
2690
- type: Input
2691
- }], DataArray: [{
2692
- type: Input
2693
- }], ColumnWidthPercentage: [{
2694
- type: Input
2695
- }], LabelWidth: [{
2696
- type: Input
2697
- }], LabelVerticalOrientationCutoffWidth: [{
2698
- type: Input
2699
- }], LabelRightWhenCompressed: [{
2700
- type: Input
2701
- }], LabelTopWhenCompressed: [{
2702
- type: Input
2703
- }] } });
2704
-
2705
- /**
2706
- * Componente specifico per la graficazione di un grafico a Barre in modalità Stacked (una serie sopra l'altra)
2707
- */
2708
- class EsVerticalStackedChartComponent extends BaseChartComponent {
2709
- /**
2710
- * @ignore
2711
- */
2712
- constructor(el, ChartLoader, ChartDispatcher, adapter, zone, platformId, ESC_DEBUG_MODE, ESC_ANIMATIONS, ESC_THEME, lc) {
2713
- super(el, platformId, zone, ChartLoader, ChartDispatcher, ESC_DEBUG_MODE, ESC_ANIMATIONS, lc.Locale, ESC_THEME);
2714
- this.adapter = adapter;
2715
- }
2716
- /**
2717
- * Ottiene le proprietà specifiche per questa tipologia di grafico per cui serve rigraficare
2718
- */
2719
- getSpecificPropertiesToCheck() {
2720
- return ["Data", "DataArray"];
2721
- }
2722
- /**
2723
- * Ottiene i Settings (Ereditati dalla classe base, quindi del tipo generico **BaseSettings**) castati al tipo specifico per questo grafico
2724
- *
2725
- * @returns {VerticalStackedChartSettings} Settings castati al tipo giusto
2726
- */
2727
- getCastedSettings() {
2728
- var _a;
2729
- return ((_a = this.Settings) !== null && _a !== void 0 ? _a : new VerticalStackedChartSettings());
2730
- }
2731
- /**
2732
- * Integra i Settings base con tutti gli Input specifici di questo grafico, dando priorità ai Settings se definiti
2733
- *
2734
- * @param {VerticalStackedChartSettings} settingsCasted Settings castati al tipo giusto
2735
- */
2736
- fillSpecificSettings(settingsCasted) {
2737
- settingsCasted.ColumnWidthPercentage = settingsCasted.ColumnWidthPercentage != null ? settingsCasted.ColumnWidthPercentage : this.ColumnWidthPercentage;
2738
- settingsCasted.LabelWidth = settingsCasted.LabelWidth != null ? settingsCasted.LabelWidth : this.LabelWidth;
2739
- settingsCasted.LabelVerticalOrientationCutoffWidth = settingsCasted.LabelVerticalOrientationCutoffWidth != null ? settingsCasted.LabelVerticalOrientationCutoffWidth : this.LabelVerticalOrientationCutoffWidth;
2740
- settingsCasted.LabelRightWhenCompressed = settingsCasted.LabelRightWhenCompressed != null ? settingsCasted.LabelRightWhenCompressed : this.LabelRightWhenCompressed;
2741
- settingsCasted.LabelTopWhenCompressed = settingsCasted.LabelTopWhenCompressed != null ? settingsCasted.LabelTopWhenCompressed : this.LabelTopWhenCompressed;
2742
- }
2743
- /**
2744
- * Effettua il rendering di questo grafico in base ai Settings
2745
- *
2746
- * @param {VerticalStackedChartSettings} settingsCasted Impostazioni di graficazione
2747
- * @returns {VerticalStackedChartService} La service utilizzata per il rendering nello stato subito successivo al rendering effettuato
2748
- */
2749
- graphicate(settingsCasted) {
2750
- return new VerticalStackedChartService(this.adapter).graphicate(this.Data, settingsCasted);
2751
- }
2752
- }
2753
- 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 });
2754
- 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 });
2755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsVerticalStackedChartComponent, decorators: [{
2756
- type: Component,
2757
- 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"] }]
2758
- }], ctorParameters: function () {
2759
- return [{ type: i0.ElementRef }, { type: ChartLoader }, { type: ChartDispatcher }, { type: BaseAdapter }, { type: i0.NgZone }, { type: Object, decorators: [{
2760
- type: Inject,
2761
- args: [PLATFORM_ID]
2762
- }] }, { type: undefined, decorators: [{
2763
- type: Inject,
2764
- args: [ESC_DEBUG_MODE]
2765
- }] }, { type: undefined, decorators: [{
2766
- type: Inject,
2767
- args: [ESC_ANIMATIONS]
2768
- }] }, { type: undefined, decorators: [{
2769
- type: Inject,
2770
- args: [ESC_THEME]
2771
- }] }, { type: i4.LocalizationService }];
2772
- }, propDecorators: { Data: [{
2773
- type: Input
2774
- }], DataArray: [{
2775
- type: Input
2776
- }], ColumnWidthPercentage: [{
2777
- type: Input
2778
- }], LabelWidth: [{
2779
- type: Input
2780
- }], LabelVerticalOrientationCutoffWidth: [{
2781
- type: Input
2782
- }], LabelRightWhenCompressed: [{
2783
- type: Input
2784
- }], LabelTopWhenCompressed: [{
2785
- type: Input
2786
- }] } });
2787
-
2788
- /**
2789
- * Classe che identifica i dati per un grafico generico paginato
2790
- */
2791
- class PagedChartData {
2792
- /**
2793
- * Costruttore
2794
- *
2795
- * @param {T} data Dati del grafico
2796
- * @param {string} title Titolo del grafico
2797
- * @param {Object} dataRetrieveDto Dto utilizzato per recuperare i dati di questo grafico
2798
- * @param {Function} dataRetrieveFunction Funzione utilizzata per ottenere i dati di questo grafico
2799
- */
2800
- constructor(data, title, dataRetrieveDto, dataRetrieveFunction) {
2801
- this.data = data;
2802
- this.title = title;
2803
- this.dataRetrieveDto = dataRetrieveDto;
2804
- this.dataRetrieveFunction = dataRetrieveFunction;
2805
- }
2806
- }
2807
-
2808
- /** Componenti esportati dal modulo */
2809
- const COMPONENTS = [
2810
- EsChartComponent,
2811
- EsLineChartComponent,
2812
- EsPieChartComponent,
2813
- EsVertical2DChartComponent,
2814
- EsVerticalChartComponent,
2815
- EsVerticalStackedChartComponent,
2816
- PageChartSelector,
2817
- EsAreaChartComponent
2818
- ];
2819
- class EsChartsModule {
2820
- static forRoot(config) {
2821
- return {
2822
- ngModule: EsChartsModule,
2823
- providers: [
2824
- ChartLoader,
2825
- ChartDispatcher,
2826
- { 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 },
2827
- { provide: ESC_THEME, useValue: (config === null || config === void 0 ? void 0 : config.theme) || 'spiritedaway' },
2828
- { provide: ESC_DEBUG_MODE, useValue: (config === null || config === void 0 ? void 0 : config.debugMode) || false },
2829
- { provide: BaseAdapter, useClass: (config === null || config === void 0 ? void 0 : config.adapter) || BaseAdapter }
2830
- ]
2831
- };
2832
- }
2833
- }
2834
- EsChartsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2835
- EsChartsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, declarations: [EsChartComponent,
2836
- EsLineChartComponent,
2837
- EsPieChartComponent,
2838
- EsVertical2DChartComponent,
2839
- EsVerticalChartComponent,
2840
- EsVerticalStackedChartComponent,
2841
- PageChartSelector,
2842
- EsAreaChartComponent], imports: [CommonModule], exports: [EsChartComponent,
2843
- EsLineChartComponent,
2844
- EsPieChartComponent,
2845
- EsVertical2DChartComponent,
2846
- EsVerticalChartComponent,
2847
- EsVerticalStackedChartComponent,
2848
- PageChartSelector,
2849
- EsAreaChartComponent] });
2850
- EsChartsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, imports: [CommonModule] });
2851
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EsChartsModule, decorators: [{
2852
- type: NgModule,
2853
- args: [{
2854
- imports: [CommonModule],
2855
- declarations: [...COMPONENTS],
2856
- exports: [...COMPONENTS]
2857
- }]
2858
- }] });
2859
-
2860
- /*
2861
- * Public API Surface of es-charts
2862
- */
2863
-
2864
- /**
2865
- * Generated bundle index. Do not edit.
2866
- */
2867
-
2868
- 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 };
2869
- //# sourceMappingURL=esfaenza-es-charts.mjs.map