@esfaenza/es-charts 11.2.14 → 11.2.15

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.
@@ -86,11 +86,10 @@
86
86
  * @param {LineSerie[]} series Lista di serie da graficare
87
87
  * @param {{upper: lower}}
88
88
  */
89
- function LineChartData(series, limit, limitColors) {
89
+ function LineChartData(series, limit) {
90
90
  if (series === void 0) { series = []; }
91
91
  this.series = series;
92
92
  this.limit = limit;
93
- this.limitColors = limitColors;
94
93
  }
95
94
  return LineChartData;
96
95
  }());
@@ -601,9 +600,13 @@
601
600
  */
602
601
  var Limit = /** @class */ (function () {
603
602
  /** @ignore */
604
- function Limit(upper, lower) {
603
+ function Limit(upper, upperLabel, upperColor, lower, lowerLabel, lowerColor) {
605
604
  this.upper = upper;
605
+ this.upperLabel = upperLabel;
606
+ this.upperColor = upperColor;
606
607
  this.lower = lower;
608
+ this.lowerLabel = lowerLabel;
609
+ this.lowerColor = lowerColor;
607
610
  }
608
611
  return Limit;
609
612
  }());
@@ -1456,7 +1459,7 @@
1456
1459
  */
1457
1460
  LineChartService.prototype.graphicate = function (data, settings) {
1458
1461
  var _this = this;
1459
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1462
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1460
1463
  var dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1461
1464
  var threshold = (_a = settings.DataGroupingThreshold) !== null && _a !== void 0 ? _a : 3000;
1462
1465
  var singleDataSet = (_b = settings.MergeDatasets) !== null && _b !== void 0 ? _b : false;
@@ -1484,14 +1487,22 @@
1484
1487
  if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
1485
1488
  var range = yAxis.axisRanges.create();
1486
1489
  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");
1490
+ range.label.inside = true;
1491
+ range.label.text = dataConverted.limit.upperLabel;
1492
+ range.label.fill = range.grid.stroke;
1493
+ range.label.verticalCenter = "bottom";
1494
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.upperColor || "#F92200");
1488
1495
  range.grid.strokeWidth = 2;
1489
1496
  range.grid.strokeOpacity = 1;
1490
1497
  }
1491
1498
  if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
1492
1499
  var range = yAxis.axisRanges.create();
1493
1500
  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");
1501
+ range.label.inside = true;
1502
+ range.label.text = dataConverted.limit.lowerLabel;
1503
+ range.label.fill = range.grid.stroke;
1504
+ range.label.verticalCenter = "bottom";
1505
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.lowerColor || "#F92200");
1495
1506
  range.grid.strokeWidth = 2;
1496
1507
  range.grid.strokeOpacity = 1;
1497
1508
  }
@@ -1509,11 +1520,11 @@
1509
1520
  dateAxis.renderer.ticks.template.length = 10;
1510
1521
  dateAxis.renderer.ticks.template.location = 0;
1511
1522
  }
1512
- dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
1523
+ dateAxis.renderer.minGridDistance = (_d = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _d !== void 0 ? _d : 50;
1513
1524
  dateAxis.renderer.grid.template.location = 0;
1514
1525
  dateAxis.minZoomCount = 5;
1515
1526
  dateAxis.groupData = dataShouldBeGrouped;
1516
- dateAxis.groupCount = (_g = settings.DataGroupBucketSize) !== null && _g !== void 0 ? _g : this.DataGroupBucketSize;
1527
+ dateAxis.groupCount = (_e = settings.DataGroupBucketSize) !== null && _e !== void 0 ? _e : this.DataGroupBucketSize;
1517
1528
  //Se ho almeno una serie ad intervallo e i settings non mi impediscono esplicitamente di usare i gaps, visualizzo i dati col gap
1518
1529
  if (gapsAllowed) {
1519
1530
  if (!seriesWithInterval) {
@@ -1652,17 +1663,17 @@
1652
1663
  });
1653
1664
  if (settings.Legend) {
1654
1665
  this.ChartInstance.legend = new am4charts__namespace.Legend();
1655
- this.ChartInstance.legend.position = (_h = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _h !== void 0 ? _h : 'right';
1666
+ this.ChartInstance.legend.position = (_f = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _f !== void 0 ? _f : 'right';
1656
1667
  this.ChartInstance.legend.scrollable = true;
1657
1668
  this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
1658
1669
  this.ChartInstance.legend.itemContainers.template.events.on("over", function (event) { _this.processOver(event.target.dataItem.dataContext); });
1659
1670
  this.ChartInstance.legend.itemContainers.template.events.on("out", function () { _this.processOut(); });
1660
1671
  if (settings.LegendPadding) {
1661
1672
  var template = this.ChartInstance.legend.itemContainers.template;
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;
1673
+ template.paddingTop = (_g = settings.LegendPadding.top) !== null && _g !== void 0 ? _g : 0;
1674
+ template.paddingBottom = (_h = settings.LegendPadding.bottom) !== null && _h !== void 0 ? _h : 0;
1675
+ template.paddingLeft = (_j = settings.LegendPadding.left) !== null && _j !== void 0 ? _j : 0;
1676
+ template.paddingRight = (_k = settings.LegendPadding.right) !== null && _k !== void 0 ? _k : 0;
1666
1677
  }
1667
1678
  }
1668
1679
  this.ChartInstance.cursor = new am4charts__namespace.XYCursor();