@esfaenza/es-charts 11.2.12 → 11.2.16

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.
@@ -84,10 +84,12 @@
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) {
89
90
  if (series === void 0) { series = []; }
90
91
  this.series = series;
92
+ this.limit = limit;
91
93
  }
92
94
  return LineChartData;
93
95
  }());
@@ -593,6 +595,22 @@
593
595
  return LegendPad;
594
596
  }());
595
597
 
598
+ /**
599
+ * Modello che identifica un limite superiore - inferiore
600
+ */
601
+ var Limit = /** @class */ (function () {
602
+ /** @ignore */
603
+ function Limit(upper, upperLabel, upperColor, lower, lowerLabel, lowerColor) {
604
+ this.upper = upper;
605
+ this.upperLabel = upperLabel;
606
+ this.upperColor = upperColor;
607
+ this.lower = lower;
608
+ this.lowerLabel = lowerLabel;
609
+ this.lowerColor = lowerColor;
610
+ }
611
+ return Limit;
612
+ }());
613
+
596
614
  /**
597
615
  * Modello che identifica la coppia Data-Valore
598
616
  */
@@ -1465,6 +1483,32 @@
1465
1483
  yAxis.min = settings.Min;
1466
1484
  if (settings.Max)
1467
1485
  yAxis.max = settings.Max;
1486
+ if (dataConverted.limit) {
1487
+ if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
1488
+ var range = yAxis.axisRanges.create();
1489
+ range.value = dataConverted.limit.upper;
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.label.stroke = am4core__namespace.color(dataConverted.limit.upperColor || "#F92200");
1495
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.upperColor || "#F92200");
1496
+ range.grid.strokeWidth = 2;
1497
+ range.grid.strokeOpacity = 1;
1498
+ }
1499
+ if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
1500
+ var range = yAxis.axisRanges.create();
1501
+ range.value = dataConverted.limit.lower;
1502
+ range.label.inside = true;
1503
+ range.label.text = dataConverted.limit.lowerLabel;
1504
+ range.label.fill = range.grid.stroke;
1505
+ range.label.verticalCenter = "bottom";
1506
+ range.label.stroke = am4core__namespace.color(dataConverted.limit.lowerColor || "#F92200");
1507
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.lowerColor || "#F92200");
1508
+ range.grid.strokeWidth = 2;
1509
+ range.grid.strokeOpacity = 1;
1510
+ }
1511
+ }
1468
1512
  var dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
1469
1513
  if (settings.XAxisTitle) {
1470
1514
  dateAxis.title.text = settings.XAxisTitle;
@@ -1624,16 +1668,8 @@
1624
1668
  this.ChartInstance.legend.position = (_f = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _f !== void 0 ? _f : 'right';
1625
1669
  this.ChartInstance.legend.scrollable = true;
1626
1670
  this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
1627
- this.ChartInstance.legend.itemContainers.template.events.on("over", function (event) {
1628
- var series = event.target.dataItem.dataContext;
1629
- var fill = series.stacked;
1630
- _this.processOver(series, fill);
1631
- });
1632
- this.ChartInstance.legend.itemContainers.template.events.on("out", function (event) {
1633
- var series = event.target.dataItem.dataContext;
1634
- var fill = series.stacked;
1635
- _this.processOut(fill);
1636
- });
1671
+ this.ChartInstance.legend.itemContainers.template.events.on("over", function (event) { _this.processOver(event.target.dataItem.dataContext); });
1672
+ this.ChartInstance.legend.itemContainers.template.events.on("out", function () { _this.processOut(); });
1637
1673
  if (settings.LegendPadding) {
1638
1674
  var template = this.ChartInstance.legend.itemContainers.template;
1639
1675
  template.paddingTop = (_g = settings.LegendPadding.top) !== null && _g !== void 0 ? _g : 0;
@@ -1682,9 +1718,10 @@
1682
1718
  }
1683
1719
  };
1684
1720
  /** @ignore */
1685
- LineChartService.prototype.processOver = function (hoveredSeries, fill) {
1721
+ LineChartService.prototype.processOver = function (hoveredSeries) {
1686
1722
  var _this = this;
1687
1723
  hoveredSeries.toFront();
1724
+ var fill = hoveredSeries.stacked;
1688
1725
  hoveredSeries.segments.each(function (segment) {
1689
1726
  segment.setState("hover");
1690
1727
  if (!fill)
@@ -1693,17 +1730,20 @@
1693
1730
  if (!fill)
1694
1731
  hoveredSeries.legendDataItem.marker.children.getIndex(1).fillOpacity = this.OpacityOnSelected;
1695
1732
  this.ChartInstance.series.each(function (series) {
1696
- if (series != hoveredSeries)
1733
+ if (series != hoveredSeries) {
1734
+ var fill_1 = series.stacked;
1697
1735
  series.segments.each(function (segment) {
1698
1736
  segment.setState("dimmed");
1699
- if (!fill)
1737
+ if (!fill_1)
1700
1738
  segment.fillSprite.fillOpacity = 0;
1701
1739
  });
1740
+ }
1702
1741
  });
1703
1742
  };
1704
1743
  /** @ignore */
1705
- LineChartService.prototype.processOut = function (fill) {
1744
+ LineChartService.prototype.processOut = function () {
1706
1745
  this.ChartInstance.series.each(function (series) {
1746
+ var fill = series.stacked;
1707
1747
  series.segments.each(function (segment) {
1708
1748
  segment.setState("default");
1709
1749
  if (!fill)
@@ -3137,6 +3177,7 @@
3137
3177
  exports.KeyValue = KeyValue;
3138
3178
  exports.KeyValueColor = KeyValueColor;
3139
3179
  exports.LegendPad = LegendPad;
3180
+ exports.Limit = Limit;
3140
3181
  exports.LineChartData = LineChartData;
3141
3182
  exports.LineChartSettings = LineChartSettings;
3142
3183
  exports.LineSerie = LineSerie;