@esfaenza/es-charts 11.2.13 → 11.2.14
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 +41 -9
- 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/models/data/classes/LineChartData.js +5 -2
- package/esm2015/lib/models/data/classes/base/Limit.js +11 -0
- package/esm2015/lib/models/data/index.js +2 -1
- package/esm2015/lib/services/classes/LineChartService.js +25 -9
- package/esm2015/public-api.js +2 -1
- package/fesm2015/esfaenza-es-charts.js +40 -10
- package/fesm2015/esfaenza-es-charts.js.map +1 -1
- package/lib/models/data/classes/LineChartData.d.ts +5 -1
- package/lib/models/data/classes/base/Limit.d.ts +9 -0
- package/lib/models/data/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -84,10 +84,13 @@
|
|
|
84
84
|
* Costruttore
|
|
85
85
|
*
|
|
86
86
|
* @param {LineSerie[]} series Lista di serie da graficare
|
|
87
|
+
* @param {{upper: lower}}
|
|
87
88
|
*/
|
|
88
|
-
function LineChartData(series) {
|
|
89
|
+
function LineChartData(series, limit, limitColors) {
|
|
89
90
|
if (series === void 0) { series = []; }
|
|
90
91
|
this.series = series;
|
|
92
|
+
this.limit = limit;
|
|
93
|
+
this.limitColors = limitColors;
|
|
91
94
|
}
|
|
92
95
|
return LineChartData;
|
|
93
96
|
}());
|
|
@@ -593,6 +596,18 @@
|
|
|
593
596
|
return LegendPad;
|
|
594
597
|
}());
|
|
595
598
|
|
|
599
|
+
/**
|
|
600
|
+
* Modello che identifica un limite superiore - inferiore
|
|
601
|
+
*/
|
|
602
|
+
var Limit = /** @class */ (function () {
|
|
603
|
+
/** @ignore */
|
|
604
|
+
function Limit(upper, lower) {
|
|
605
|
+
this.upper = upper;
|
|
606
|
+
this.lower = lower;
|
|
607
|
+
}
|
|
608
|
+
return Limit;
|
|
609
|
+
}());
|
|
610
|
+
|
|
596
611
|
/**
|
|
597
612
|
* Modello che identifica la coppia Data-Valore
|
|
598
613
|
*/
|
|
@@ -1441,7 +1456,7 @@
|
|
|
1441
1456
|
*/
|
|
1442
1457
|
LineChartService.prototype.graphicate = function (data, settings) {
|
|
1443
1458
|
var _this = this;
|
|
1444
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1459
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1445
1460
|
var dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
|
|
1446
1461
|
var threshold = (_a = settings.DataGroupingThreshold) !== null && _a !== void 0 ? _a : 3000;
|
|
1447
1462
|
var singleDataSet = (_b = settings.MergeDatasets) !== null && _b !== void 0 ? _b : false;
|
|
@@ -1465,6 +1480,22 @@
|
|
|
1465
1480
|
yAxis.min = settings.Min;
|
|
1466
1481
|
if (settings.Max)
|
|
1467
1482
|
yAxis.max = settings.Max;
|
|
1483
|
+
if (dataConverted.limit) {
|
|
1484
|
+
if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
|
|
1485
|
+
var range = yAxis.axisRanges.create();
|
|
1486
|
+
range.value = dataConverted.limit.upper;
|
|
1487
|
+
range.grid.stroke = am4core__namespace.color(((_d = dataConverted === null || dataConverted === void 0 ? void 0 : dataConverted.limitColors) === null || _d === void 0 ? void 0 : _d.upper) || "#F92200");
|
|
1488
|
+
range.grid.strokeWidth = 2;
|
|
1489
|
+
range.grid.strokeOpacity = 1;
|
|
1490
|
+
}
|
|
1491
|
+
if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
|
|
1492
|
+
var range = yAxis.axisRanges.create();
|
|
1493
|
+
range.value = dataConverted.limit.lower;
|
|
1494
|
+
range.grid.stroke = am4core__namespace.color(((_e = dataConverted === null || dataConverted === void 0 ? void 0 : dataConverted.limitColors) === null || _e === void 0 ? void 0 : _e.lower) || "#F92200");
|
|
1495
|
+
range.grid.strokeWidth = 2;
|
|
1496
|
+
range.grid.strokeOpacity = 1;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1468
1499
|
var dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
|
|
1469
1500
|
if (settings.XAxisTitle) {
|
|
1470
1501
|
dateAxis.title.text = settings.XAxisTitle;
|
|
@@ -1478,11 +1509,11 @@
|
|
|
1478
1509
|
dateAxis.renderer.ticks.template.length = 10;
|
|
1479
1510
|
dateAxis.renderer.ticks.template.location = 0;
|
|
1480
1511
|
}
|
|
1481
|
-
dateAxis.renderer.minGridDistance = (
|
|
1512
|
+
dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
|
|
1482
1513
|
dateAxis.renderer.grid.template.location = 0;
|
|
1483
1514
|
dateAxis.minZoomCount = 5;
|
|
1484
1515
|
dateAxis.groupData = dataShouldBeGrouped;
|
|
1485
|
-
dateAxis.groupCount = (
|
|
1516
|
+
dateAxis.groupCount = (_g = settings.DataGroupBucketSize) !== null && _g !== void 0 ? _g : this.DataGroupBucketSize;
|
|
1486
1517
|
//Se ho almeno una serie ad intervallo e i settings non mi impediscono esplicitamente di usare i gaps, visualizzo i dati col gap
|
|
1487
1518
|
if (gapsAllowed) {
|
|
1488
1519
|
if (!seriesWithInterval) {
|
|
@@ -1621,17 +1652,17 @@
|
|
|
1621
1652
|
});
|
|
1622
1653
|
if (settings.Legend) {
|
|
1623
1654
|
this.ChartInstance.legend = new am4charts__namespace.Legend();
|
|
1624
|
-
this.ChartInstance.legend.position = (
|
|
1655
|
+
this.ChartInstance.legend.position = (_h = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _h !== void 0 ? _h : 'right';
|
|
1625
1656
|
this.ChartInstance.legend.scrollable = true;
|
|
1626
1657
|
this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
|
|
1627
1658
|
this.ChartInstance.legend.itemContainers.template.events.on("over", function (event) { _this.processOver(event.target.dataItem.dataContext); });
|
|
1628
1659
|
this.ChartInstance.legend.itemContainers.template.events.on("out", function () { _this.processOut(); });
|
|
1629
1660
|
if (settings.LegendPadding) {
|
|
1630
1661
|
var template = this.ChartInstance.legend.itemContainers.template;
|
|
1631
|
-
template.paddingTop = (
|
|
1632
|
-
template.paddingBottom = (
|
|
1633
|
-
template.paddingLeft = (
|
|
1634
|
-
template.paddingRight = (
|
|
1662
|
+
template.paddingTop = (_j = settings.LegendPadding.top) !== null && _j !== void 0 ? _j : 0;
|
|
1663
|
+
template.paddingBottom = (_k = settings.LegendPadding.bottom) !== null && _k !== void 0 ? _k : 0;
|
|
1664
|
+
template.paddingLeft = (_l = settings.LegendPadding.left) !== null && _l !== void 0 ? _l : 0;
|
|
1665
|
+
template.paddingRight = (_m = settings.LegendPadding.right) !== null && _m !== void 0 ? _m : 0;
|
|
1635
1666
|
}
|
|
1636
1667
|
}
|
|
1637
1668
|
this.ChartInstance.cursor = new am4charts__namespace.XYCursor();
|
|
@@ -3133,6 +3164,7 @@
|
|
|
3133
3164
|
exports.KeyValue = KeyValue;
|
|
3134
3165
|
exports.KeyValueColor = KeyValueColor;
|
|
3135
3166
|
exports.LegendPad = LegendPad;
|
|
3167
|
+
exports.Limit = Limit;
|
|
3136
3168
|
exports.LineChartData = LineChartData;
|
|
3137
3169
|
exports.LineChartSettings = LineChartSettings;
|
|
3138
3170
|
exports.LineSerie = LineSerie;
|