@esfaenza/es-charts 11.2.24 → 11.2.27

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.
Files changed (28) hide show
  1. package/bundles/esfaenza-es-charts.umd.js +80 -26
  2. package/bundles/esfaenza-es-charts.umd.js.map +1 -1
  3. package/bundles/esfaenza-es-charts.umd.min.js +1 -1
  4. package/bundles/esfaenza-es-charts.umd.min.js.map +1 -1
  5. package/esfaenza-es-charts.metadata.json +1 -1
  6. package/esm2015/lib/components/base/base-chart.component.js +10 -1
  7. package/esm2015/lib/models/data/LineChartData.js +1 -1
  8. package/esm2015/lib/models/data/base/Limit.js +3 -2
  9. package/esm2015/lib/services/AreaChartService.js +4 -1
  10. package/esm2015/lib/services/LineChartService.js +54 -26
  11. package/esm2015/lib/services/PieChartService.js +4 -1
  12. package/esm2015/lib/services/Vertical2DChartService.js +4 -1
  13. package/esm2015/lib/services/VerticalChartService.js +4 -1
  14. package/esm2015/lib/services/VerticalStackedChartService.js +4 -1
  15. package/esm2015/lib/services/base/IBaseService.js +1 -1
  16. package/fesm2015/esfaenza-es-charts.js +79 -26
  17. package/fesm2015/esfaenza-es-charts.js.map +1 -1
  18. package/lib/components/base/base-chart.component.d.ts +7 -0
  19. package/lib/models/data/LineChartData.d.ts +2 -2
  20. package/lib/models/data/base/Limit.d.ts +2 -1
  21. package/lib/services/AreaChartService.d.ts +2 -0
  22. package/lib/services/LineChartService.d.ts +4 -0
  23. package/lib/services/PieChartService.d.ts +2 -0
  24. package/lib/services/Vertical2DChartService.d.ts +2 -0
  25. package/lib/services/VerticalChartService.d.ts +2 -0
  26. package/lib/services/VerticalStackedChartService.d.ts +2 -0
  27. package/lib/services/base/IBaseService.d.ts +7 -0
  28. package/package.json +1 -1
@@ -600,13 +600,15 @@
600
600
  */
601
601
  var Limit = /** @class */ (function () {
602
602
  /** @ignore */
603
- function Limit(upper, upperlabel, uppercolor, lower, lowerlabel, lowercolor) {
603
+ function Limit(upper, upperlabel, uppercolor, lower, lowerlabel, lowercolor, fillColor) {
604
+ if (fillColor === void 0) { fillColor = ""; }
604
605
  this.upper = upper;
605
606
  this.upperlabel = upperlabel;
606
607
  this.uppercolor = uppercolor;
607
608
  this.lower = lower;
608
609
  this.lowerlabel = lowerlabel;
609
610
  this.lowercolor = lowercolor;
611
+ this.fillColor = fillColor;
610
612
  }
611
613
  return Limit;
612
614
  }());
@@ -1482,6 +1484,15 @@
1482
1484
  if (this.logs)
1483
1485
  console.log("@esfaenza/es-charts: " + log);
1484
1486
  };
1487
+ /**
1488
+ * Imposta lo zoom dal **from** al **to**
1489
+ *
1490
+ * @param {Date} from Inizio dello zoom
1491
+ * @param {Date} to Fine dello zoom
1492
+ */
1493
+ BaseChartComponent.prototype.setSelection = function (from, to) {
1494
+ this.ChartService.setSelection(from, to);
1495
+ };
1485
1496
  /**
1486
1497
  * @ignore
1487
1498
  */
@@ -1584,33 +1595,57 @@
1584
1595
  yAxis.min = settings.Min;
1585
1596
  if (settings.Max)
1586
1597
  yAxis.max = settings.Max;
1587
- if (dataConverted.limit) {
1588
- if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
1589
- var range = yAxis.axisRanges.create();
1590
- range.value = dataConverted.limit.upper;
1591
- range.label.inside = true;
1592
- range.label.text = dataConverted.limit.upperlabel;
1593
- range.label.fill = range.grid.stroke;
1594
- range.label.verticalCenter = "bottom";
1595
- range.label.stroke = am4core__namespace.color(dataConverted.limit.uppercolor || "#F92200");
1596
- range.grid.stroke = am4core__namespace.color(dataConverted.limit.uppercolor || "#F92200");
1597
- range.grid.strokeWidth = 2;
1598
- range.grid.strokeOpacity = 1;
1599
- }
1600
- if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
1601
- var range = yAxis.axisRanges.create();
1602
- range.value = dataConverted.limit.lower;
1603
- range.label.inside = true;
1604
- range.label.text = dataConverted.limit.lowerlabel;
1605
- range.label.fill = range.grid.stroke;
1606
- range.label.verticalCenter = "bottom";
1607
- range.label.stroke = am4core__namespace.color(dataConverted.limit.lowercolor || "#F92200");
1608
- range.grid.stroke = am4core__namespace.color(dataConverted.limit.lowercolor || "#F92200");
1609
- range.grid.strokeWidth = 2;
1610
- range.grid.strokeOpacity = 1;
1598
+ var limitNullOrUndef = dataConverted.limit != null && dataConverted.limit != undefined;
1599
+ var limits = limitNullOrUndef ? [] : !dataConverted.limit.length ? [dataConverted.limit] : dataConverted.limit;
1600
+ if (limits.length > 0) {
1601
+ for (var i = 0; i < limits.length; i++) {
1602
+ var limit = dataConverted.limit[i];
1603
+ if (limit.upper != null && limit.upper != undefined && limit.lower != null && limit.lower != undefined) {
1604
+ var range = yAxis.axisRanges.create();
1605
+ range.value = limit.lower;
1606
+ range.endValue = limit.upper;
1607
+ if (limit.fillColor) {
1608
+ range.contents.stroke = am4core__namespace.color(limit.fillColor);
1609
+ range.contents.fill = range.contents.stroke;
1610
+ }
1611
+ range.label.inside = true;
1612
+ range.label.text = limit.upperlabel;
1613
+ range.label.fill = range.grid.stroke;
1614
+ range.label.verticalCenter = "bottom";
1615
+ range.label.stroke = am4core__namespace.color(limit.uppercolor || "#F92200");
1616
+ range.grid.stroke = am4core__namespace.color(limit.uppercolor || "#F92200");
1617
+ range.grid.strokeWidth = 2;
1618
+ range.grid.strokeOpacity = 1;
1619
+ }
1620
+ else if ((limit.lower == null || limit.lower == undefined) && limit.upper != null && limit.upper != undefined) {
1621
+ var range = yAxis.axisRanges.create();
1622
+ range.value = limit.upper;
1623
+ range.label.inside = true;
1624
+ range.label.text = limit.upperlabel;
1625
+ range.label.fill = range.grid.stroke;
1626
+ range.label.verticalCenter = "bottom";
1627
+ range.label.stroke = am4core__namespace.color(limit.uppercolor || "#F92200");
1628
+ range.grid.stroke = am4core__namespace.color(limit.uppercolor || "#F92200");
1629
+ range.grid.strokeWidth = 2;
1630
+ range.grid.strokeOpacity = 1;
1631
+ }
1632
+ else if ((limit.upper == null || limit.upper == undefined) && limit.lower != null && limit.lower != undefined) {
1633
+ var range = yAxis.axisRanges.create();
1634
+ range.value = limit.lower;
1635
+ range.label.inside = true;
1636
+ range.label.text = limit.lowerlabel;
1637
+ range.label.fill = range.grid.stroke;
1638
+ range.label.verticalCenter = "bottom";
1639
+ range.label.stroke = am4core__namespace.color(limit.lowercolor || "#F92200");
1640
+ range.grid.stroke = am4core__namespace.color(limit.lowercolor || "#F92200");
1641
+ range.grid.strokeWidth = 2;
1642
+ range.grid.strokeOpacity = 1;
1643
+ }
1611
1644
  }
1612
1645
  }
1613
- var dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
1646
+ this.dateAxis = ChartInstanceCasted.xAxes.push(new am4charts__namespace.DateAxis());
1647
+ // Per comatibilità col codice scritto quando non era a livello globale, mi scoccia sostituire
1648
+ var dateAxis = this.dateAxis;
1614
1649
  if (settings.XAxisTitle) {
1615
1650
  dateAxis.title.text = settings.XAxisTitle;
1616
1651
  dateAxis.title.fontWeight = "bold";
@@ -1781,6 +1816,10 @@
1781
1816
  return this;
1782
1817
  };
1783
1818
  /** @ignore */
1819
+ LineChartService.prototype.setSelection = function (from, to) {
1820
+ this.dateAxis.zoomToDates(from, to, true, true);
1821
+ };
1822
+ /** @ignore */
1784
1823
  LineChartService.prototype.refreshData = function (data) {
1785
1824
  var dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1786
1825
  if (this.singleDataSet) {
@@ -1975,6 +2014,9 @@
1975
2014
  return this;
1976
2015
  };
1977
2016
  /** @ignore */
2017
+ PieChartService.prototype.setSelection = function (from, to) {
2018
+ };
2019
+ /** @ignore */
1978
2020
  PieChartService.prototype.refreshData = function (data) {
1979
2021
  //TODO:IMPL
1980
2022
  };
@@ -2087,6 +2129,9 @@
2087
2129
  return this;
2088
2130
  };
2089
2131
  /** @ignore */
2132
+ VerticalChartService.prototype.setSelection = function (from, to) {
2133
+ };
2134
+ /** @ignore */
2090
2135
  VerticalChartService.prototype.refreshData = function (data) {
2091
2136
  //TODO:IMPL
2092
2137
  };
@@ -2202,6 +2247,9 @@
2202
2247
  return this;
2203
2248
  };
2204
2249
  /** @ignore */
2250
+ Vertical2DChartService.prototype.setSelection = function (from, to) {
2251
+ };
2252
+ /** @ignore */
2205
2253
  Vertical2DChartService.prototype.refreshData = function (data) {
2206
2254
  //TODO:IMPL
2207
2255
  };
@@ -2362,6 +2410,9 @@
2362
2410
  return this;
2363
2411
  };
2364
2412
  /** @ignore */
2413
+ VerticalStackedChartService.prototype.setSelection = function (from, to) {
2414
+ };
2415
+ /** @ignore */
2365
2416
  VerticalStackedChartService.prototype.refreshData = function (data) {
2366
2417
  //TODO:IMPL
2367
2418
  };
@@ -2477,6 +2528,9 @@
2477
2528
  return this;
2478
2529
  };
2479
2530
  /** @ignore */
2531
+ AreaChartService.prototype.setSelection = function (from, to) {
2532
+ };
2533
+ /** @ignore */
2480
2534
  AreaChartService.prototype.refreshData = function (data) {
2481
2535
  //TODO:IMPL
2482
2536
  };