@esfaenza/es-charts 11.2.14 → 11.2.18
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.
- package/bundles/esfaenza-es-charts.umd.js +34 -15
- package/bundles/esfaenza-es-charts.umd.js.map +1 -1
- package/bundles/esfaenza-es-charts.umd.min.js +1 -1
- package/bundles/esfaenza-es-charts.umd.min.js.map +1 -1
- package/esfaenza-es-charts.metadata.json +1 -1
- package/esm2015/lib/components/base/base-chart.component.js +9 -3
- package/esm2015/lib/models/data/classes/LineChartData.js +2 -3
- package/esm2015/lib/models/data/classes/base/Limit.js +6 -2
- package/esm2015/lib/services/classes/LineChartService.js +21 -11
- package/fesm2015/esfaenza-es-charts.js +34 -15
- package/fesm2015/esfaenza-es-charts.js.map +1 -1
- package/lib/components/base/base-chart.component.d.ts +5 -0
- package/lib/models/data/classes/LineChartData.d.ts +2 -3
- package/lib/models/data/classes/base/Limit.d.ts +8 -4
- package/package.json +3 -3
|
@@ -60,10 +60,9 @@ class LineChartData {
|
|
|
60
60
|
* @param {LineSerie[]} series Lista di serie da graficare
|
|
61
61
|
* @param {{upper: lower}}
|
|
62
62
|
*/
|
|
63
|
-
constructor(series = [], limit
|
|
63
|
+
constructor(series = [], limit) {
|
|
64
64
|
this.series = series;
|
|
65
65
|
this.limit = limit;
|
|
66
|
-
this.limitColors = limitColors;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -220,9 +219,13 @@ class LegendPad {
|
|
|
220
219
|
*/
|
|
221
220
|
class Limit {
|
|
222
221
|
/** @ignore */
|
|
223
|
-
constructor(upper, lower) {
|
|
222
|
+
constructor(upper, upperLabel, upperColor, lower, lowerLabel, lowerColor) {
|
|
224
223
|
this.upper = upper;
|
|
224
|
+
this.upperLabel = upperLabel;
|
|
225
|
+
this.upperColor = upperColor;
|
|
225
226
|
this.lower = lower;
|
|
227
|
+
this.lowerLabel = lowerLabel;
|
|
228
|
+
this.lowerColor = lowerColor;
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
231
|
|
|
@@ -702,6 +705,11 @@ class BaseChartComponent {
|
|
|
702
705
|
* Evento lanciato al termine del caricamento di una nuova pagina del grafico
|
|
703
706
|
*/
|
|
704
707
|
this.onLoadEnd = new EventEmitter();
|
|
708
|
+
/**
|
|
709
|
+
* Evento lanciato al termine della creazione del grafico referenziando l'istanza nativa del grafico creato in modo da poter effettuare modifiche
|
|
710
|
+
* post inizializzazione lato applicativo
|
|
711
|
+
*/
|
|
712
|
+
this.chartLoaded = new EventEmitter();
|
|
705
713
|
/**
|
|
706
714
|
* Serve a decidere se sarà presente l'interfaccia di paginazione
|
|
707
715
|
*/
|
|
@@ -790,7 +798,7 @@ class BaseChartComponent {
|
|
|
790
798
|
this.Chart = this.ChartService.ChartInstance;
|
|
791
799
|
if (!this.Chart)
|
|
792
800
|
this.log("Chart " + this.name + ": Could not create graph");
|
|
793
|
-
return this.Charter.applyLocale(this.Chart, this.Locale).then(() => this.initDone = true);
|
|
801
|
+
return this.Charter.applyLocale(this.Chart, this.Locale).then(() => { this.initDone = true; this.chartLoaded.emit(this.Chart); });
|
|
794
802
|
})
|
|
795
803
|
]);
|
|
796
804
|
}
|
|
@@ -952,7 +960,8 @@ BaseChartComponent.propDecorators = {
|
|
|
952
960
|
onSelectionChanged: [{ type: Output }],
|
|
953
961
|
onSeriesClicked: [{ type: Output }],
|
|
954
962
|
onLoadStart: [{ type: Output }],
|
|
955
|
-
onLoadEnd: [{ type: Output }]
|
|
963
|
+
onLoadEnd: [{ type: Output }],
|
|
964
|
+
chartLoaded: [{ type: Output }]
|
|
956
965
|
};
|
|
957
966
|
|
|
958
967
|
/**
|
|
@@ -976,7 +985,7 @@ class LineChartService {
|
|
|
976
985
|
* Metodo che data una coppia Dati - Impostazioni li utilizza per creare e visualizzare un LineChart
|
|
977
986
|
*/
|
|
978
987
|
graphicate(data, settings) {
|
|
979
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
988
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
980
989
|
let dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
|
|
981
990
|
let threshold = (_a = settings.DataGroupingThreshold) !== null && _a !== void 0 ? _a : 3000;
|
|
982
991
|
let singleDataSet = (_b = settings.MergeDatasets) !== null && _b !== void 0 ? _b : false;
|
|
@@ -1004,14 +1013,24 @@ class LineChartService {
|
|
|
1004
1013
|
if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
|
|
1005
1014
|
let range = yAxis.axisRanges.create();
|
|
1006
1015
|
range.value = dataConverted.limit.upper;
|
|
1007
|
-
range.
|
|
1016
|
+
range.label.inside = true;
|
|
1017
|
+
range.label.text = dataConverted.limit.upperLabel;
|
|
1018
|
+
range.label.fill = range.grid.stroke;
|
|
1019
|
+
range.label.verticalCenter = "bottom";
|
|
1020
|
+
range.label.stroke = am4core.color(dataConverted.limit.upperColor || "#F92200");
|
|
1021
|
+
range.grid.stroke = am4core.color(dataConverted.limit.upperColor || "#F92200");
|
|
1008
1022
|
range.grid.strokeWidth = 2;
|
|
1009
1023
|
range.grid.strokeOpacity = 1;
|
|
1010
1024
|
}
|
|
1011
1025
|
if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
|
|
1012
1026
|
let range = yAxis.axisRanges.create();
|
|
1013
1027
|
range.value = dataConverted.limit.lower;
|
|
1014
|
-
range.
|
|
1028
|
+
range.label.inside = true;
|
|
1029
|
+
range.label.text = dataConverted.limit.lowerLabel;
|
|
1030
|
+
range.label.fill = range.grid.stroke;
|
|
1031
|
+
range.label.verticalCenter = "bottom";
|
|
1032
|
+
range.label.stroke = am4core.color(dataConverted.limit.lowerColor || "#F92200");
|
|
1033
|
+
range.grid.stroke = am4core.color(dataConverted.limit.lowerColor || "#F92200");
|
|
1015
1034
|
range.grid.strokeWidth = 2;
|
|
1016
1035
|
range.grid.strokeOpacity = 1;
|
|
1017
1036
|
}
|
|
@@ -1029,11 +1048,11 @@ class LineChartService {
|
|
|
1029
1048
|
dateAxis.renderer.ticks.template.length = 10;
|
|
1030
1049
|
dateAxis.renderer.ticks.template.location = 0;
|
|
1031
1050
|
}
|
|
1032
|
-
dateAxis.renderer.minGridDistance = (
|
|
1051
|
+
dateAxis.renderer.minGridDistance = (_d = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _d !== void 0 ? _d : 50;
|
|
1033
1052
|
dateAxis.renderer.grid.template.location = 0;
|
|
1034
1053
|
dateAxis.minZoomCount = 5;
|
|
1035
1054
|
dateAxis.groupData = dataShouldBeGrouped;
|
|
1036
|
-
dateAxis.groupCount = (
|
|
1055
|
+
dateAxis.groupCount = (_e = settings.DataGroupBucketSize) !== null && _e !== void 0 ? _e : this.DataGroupBucketSize;
|
|
1037
1056
|
//Se ho almeno una serie ad intervallo e i settings non mi impediscono esplicitamente di usare i gaps, visualizzo i dati col gap
|
|
1038
1057
|
if (gapsAllowed) {
|
|
1039
1058
|
if (!seriesWithInterval) {
|
|
@@ -1172,17 +1191,17 @@ class LineChartService {
|
|
|
1172
1191
|
});
|
|
1173
1192
|
if (settings.Legend) {
|
|
1174
1193
|
this.ChartInstance.legend = new am4charts.Legend();
|
|
1175
|
-
this.ChartInstance.legend.position = (
|
|
1194
|
+
this.ChartInstance.legend.position = (_f = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _f !== void 0 ? _f : 'right';
|
|
1176
1195
|
this.ChartInstance.legend.scrollable = true;
|
|
1177
1196
|
this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
|
|
1178
1197
|
this.ChartInstance.legend.itemContainers.template.events.on("over", (event) => { this.processOver(event.target.dataItem.dataContext); });
|
|
1179
1198
|
this.ChartInstance.legend.itemContainers.template.events.on("out", () => { this.processOut(); });
|
|
1180
1199
|
if (settings.LegendPadding) {
|
|
1181
1200
|
let template = this.ChartInstance.legend.itemContainers.template;
|
|
1182
|
-
template.paddingTop = (
|
|
1183
|
-
template.paddingBottom = (
|
|
1184
|
-
template.paddingLeft = (
|
|
1185
|
-
template.paddingRight = (
|
|
1201
|
+
template.paddingTop = (_g = settings.LegendPadding.top) !== null && _g !== void 0 ? _g : 0;
|
|
1202
|
+
template.paddingBottom = (_h = settings.LegendPadding.bottom) !== null && _h !== void 0 ? _h : 0;
|
|
1203
|
+
template.paddingLeft = (_j = settings.LegendPadding.left) !== null && _j !== void 0 ? _j : 0;
|
|
1204
|
+
template.paddingRight = (_k = settings.LegendPadding.right) !== null && _k !== void 0 ? _k : 0;
|
|
1186
1205
|
}
|
|
1187
1206
|
}
|
|
1188
1207
|
this.ChartInstance.cursor = new am4charts.XYCursor();
|