@esfaenza/es-charts 11.2.28 → 11.2.31
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 +19 -17
- 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/esm2015/lib/models/data/Vertical2DChartData.js +4 -4
- package/esm2015/lib/services/LineChartService.js +15 -13
- package/esm2015/lib/services/Vertical2DChartService.js +3 -3
- package/fesm2015/esfaenza-es-charts.js +19 -17
- package/fesm2015/esfaenza-es-charts.js.map +1 -1
- package/lib/models/data/Vertical2DChartData.d.ts +3 -3
- package/package.json +1 -1
|
@@ -136,12 +136,12 @@
|
|
|
136
136
|
* Costruttore
|
|
137
137
|
*
|
|
138
138
|
* @param {{ name: string; values: KeyValue[]; }[]} groups Gruppi di valori raggruppati per nome
|
|
139
|
-
* @param {{ color: string }[]}
|
|
139
|
+
* @param {{ color: string }[]} colorinfos Lista dei colori da utilizzare. Vanno a sovrascrivere quelli di default di amcharts
|
|
140
140
|
*/
|
|
141
|
-
function Vertical2DChartData(groups,
|
|
141
|
+
function Vertical2DChartData(groups, colorinfos) {
|
|
142
142
|
if (groups === void 0) { groups = []; }
|
|
143
143
|
this.groups = groups;
|
|
144
|
-
this.
|
|
144
|
+
this.colorinfos = colorinfos;
|
|
145
145
|
}
|
|
146
146
|
return Vertical2DChartData;
|
|
147
147
|
}());
|
|
@@ -1599,7 +1599,7 @@
|
|
|
1599
1599
|
var limits = limitNullOrUndef ? [] : !dataConverted.limit.length ? [dataConverted.limit] : dataConverted.limit;
|
|
1600
1600
|
if (limits.length > 0) {
|
|
1601
1601
|
for (var i = 0; i < limits.length; i++) {
|
|
1602
|
-
var limit =
|
|
1602
|
+
var limit = limits[i];
|
|
1603
1603
|
if (limit.upper != null && limit.upper != undefined && limit.lower != null && limit.lower != undefined) {
|
|
1604
1604
|
var range = yAxis.axisRanges.create();
|
|
1605
1605
|
range.value = limit.lower;
|
|
@@ -1676,15 +1676,8 @@
|
|
|
1676
1676
|
var seriesToPush = [];
|
|
1677
1677
|
var seriesColors = [];
|
|
1678
1678
|
var defaultIndex = 0;
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
this.ChartInstance.data = this.generateSingleDataset(dataConverted);
|
|
1682
|
-
;
|
|
1683
|
-
dateAxis.cursorTooltipEnabled = false;
|
|
1684
|
-
}
|
|
1685
|
-
//-- Fine generazione
|
|
1686
|
-
dataConverted.series.forEach(function (s, index) {
|
|
1687
|
-
var _a, _b, _c;
|
|
1679
|
+
// Ordinamento dei dati se serve
|
|
1680
|
+
dataConverted.series.forEach(function (s) {
|
|
1688
1681
|
if (s.values[0] && !(s.values[0].d instanceof Date)) {
|
|
1689
1682
|
for (var v = 0; v < s.values.length; v++)
|
|
1690
1683
|
s.values[v].d = new Date(s.values[v].d);
|
|
@@ -1701,6 +1694,15 @@
|
|
|
1701
1694
|
}
|
|
1702
1695
|
if (!correctOrder)
|
|
1703
1696
|
s.values.sort(function (d1, d2) { return d1.d.getTime() - d2.d.getTime(); });
|
|
1697
|
+
});
|
|
1698
|
+
// Generazione di un unico dataset invece che N, per poter gestire un unico tooltip
|
|
1699
|
+
if (this.singleDataSet) {
|
|
1700
|
+
this.ChartInstance.data = this.generateSingleDataset(dataConverted);
|
|
1701
|
+
;
|
|
1702
|
+
dateAxis.cursorTooltipEnabled = false;
|
|
1703
|
+
}
|
|
1704
|
+
dataConverted.series.forEach(function (s, index) {
|
|
1705
|
+
var _a, _b, _c;
|
|
1704
1706
|
var fill = s.fill != null && s.fill != undefined ? s.fill : ((_a = settings === null || settings === void 0 ? void 0 : settings.Fill) !== null && _a !== void 0 ? _a : false);
|
|
1705
1707
|
var series = (settings === null || settings === void 0 ? void 0 : settings.Step) ? new am4charts__namespace.StepLineSeries() : new am4charts__namespace.LineSeries();
|
|
1706
1708
|
series.dataFields.valueY = "v" + (_this.singleDataSet ? index : "");
|
|
@@ -1726,7 +1728,7 @@
|
|
|
1726
1728
|
series.tooltip.hiddenState.transitionDuration = 0;
|
|
1727
1729
|
//Utilizzo il mio dateService per la formattazione della data in modo che non debba mai gestire n formati fra n librerie... bellissimo
|
|
1728
1730
|
series.dateFormatter.format = function (source) {
|
|
1729
|
-
if (interval && finalInstant) {
|
|
1731
|
+
if (interval && finalInstant && ["hour", "minute", "second"].includes(interval.timeunit)) {
|
|
1730
1732
|
var timepart = null;
|
|
1731
1733
|
switch (interval.timeunit) {
|
|
1732
1734
|
case "hour":
|
|
@@ -1743,7 +1745,7 @@
|
|
|
1743
1745
|
return _this.dateExts.adjustDateToFinalInstant(source, timepart, interval ? interval.timeunit == "second" : false);
|
|
1744
1746
|
}
|
|
1745
1747
|
else
|
|
1746
|
-
return _this.dateExts.getFormatted(source, false, interval ? interval.timeunit == "second" : false);
|
|
1748
|
+
return _this.dateExts.getFormatted(source, interval ? ["day", "week", "month", "year"].includes(interval.timeunit) : false, interval ? interval.timeunit == "second" : false);
|
|
1747
1749
|
};
|
|
1748
1750
|
series.adapter.add("tooltipText", function () {
|
|
1749
1751
|
var text = "[bold]{dateX.formatDate()}[/]\n";
|
|
@@ -2238,8 +2240,8 @@
|
|
|
2238
2240
|
dataConverted.push(obj);
|
|
2239
2241
|
}
|
|
2240
2242
|
ChartInstanceCasted.data = dataConverted;
|
|
2241
|
-
if (dataPreConverted.
|
|
2242
|
-
ChartInstanceCasted.colors.list = dataPreConverted.
|
|
2243
|
+
if (dataPreConverted.colorinfos)
|
|
2244
|
+
ChartInstanceCasted.colors.list = dataPreConverted.colorinfos.map(function (c) { return am4core__namespace.color(c.color); });
|
|
2243
2245
|
//Prendo la prima categoria e mi baso sulle proprietà per dfeinire le serie
|
|
2244
2246
|
for (var prop in dataConverted[0])
|
|
2245
2247
|
if (prop !== "key")
|