@esfaenza/es-charts 11.2.14 → 11.2.18

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
  }());
@@ -1170,6 +1173,11 @@
1170
1173
  * Evento lanciato al termine del caricamento di una nuova pagina del grafico
1171
1174
  */
1172
1175
  this.onLoadEnd = new core.EventEmitter();
1176
+ /**
1177
+ * Evento lanciato al termine della creazione del grafico referenziando l'istanza nativa del grafico creato in modo da poter effettuare modifiche
1178
+ * post inizializzazione lato applicativo
1179
+ */
1180
+ this.chartLoaded = new core.EventEmitter();
1173
1181
  /**
1174
1182
  * Serve a decidere se sarà presente l'interfaccia di paginazione
1175
1183
  */
@@ -1261,7 +1269,7 @@
1261
1269
  _this.Chart = _this.ChartService.ChartInstance;
1262
1270
  if (!_this.Chart)
1263
1271
  _this.log("Chart " + _this.name + ": Could not create graph");
1264
- return _this.Charter.applyLocale(_this.Chart, _this.Locale).then(function () { return _this.initDone = true; });
1272
+ return _this.Charter.applyLocale(_this.Chart, _this.Locale).then(function () { _this.initDone = true; _this.chartLoaded.emit(_this.Chart); });
1265
1273
  })
1266
1274
  ]);
1267
1275
  };
@@ -1431,7 +1439,8 @@
1431
1439
  onSelectionChanged: [{ type: core.Output }],
1432
1440
  onSeriesClicked: [{ type: core.Output }],
1433
1441
  onLoadStart: [{ type: core.Output }],
1434
- onLoadEnd: [{ type: core.Output }]
1442
+ onLoadEnd: [{ type: core.Output }],
1443
+ chartLoaded: [{ type: core.Output }]
1435
1444
  };
1436
1445
 
1437
1446
  /**
@@ -1456,7 +1465,7 @@
1456
1465
  */
1457
1466
  LineChartService.prototype.graphicate = function (data, settings) {
1458
1467
  var _this = this;
1459
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1468
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1460
1469
  var dataConverted = this.Adapter ? this.Adapter.adaptDataForLineChart(data) : data;
1461
1470
  var threshold = (_a = settings.DataGroupingThreshold) !== null && _a !== void 0 ? _a : 3000;
1462
1471
  var singleDataSet = (_b = settings.MergeDatasets) !== null && _b !== void 0 ? _b : false;
@@ -1484,14 +1493,24 @@
1484
1493
  if (dataConverted.limit.upper != null && dataConverted.limit.upper != undefined) {
1485
1494
  var range = yAxis.axisRanges.create();
1486
1495
  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");
1496
+ range.label.inside = true;
1497
+ range.label.text = dataConverted.limit.upperLabel;
1498
+ range.label.fill = range.grid.stroke;
1499
+ range.label.verticalCenter = "bottom";
1500
+ range.label.stroke = am4core__namespace.color(dataConverted.limit.upperColor || "#F92200");
1501
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.upperColor || "#F92200");
1488
1502
  range.grid.strokeWidth = 2;
1489
1503
  range.grid.strokeOpacity = 1;
1490
1504
  }
1491
1505
  if (dataConverted.limit.lower != null && dataConverted.limit.lower != undefined) {
1492
1506
  var range = yAxis.axisRanges.create();
1493
1507
  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");
1508
+ range.label.inside = true;
1509
+ range.label.text = dataConverted.limit.lowerLabel;
1510
+ range.label.fill = range.grid.stroke;
1511
+ range.label.verticalCenter = "bottom";
1512
+ range.label.stroke = am4core__namespace.color(dataConverted.limit.lowerColor || "#F92200");
1513
+ range.grid.stroke = am4core__namespace.color(dataConverted.limit.lowerColor || "#F92200");
1495
1514
  range.grid.strokeWidth = 2;
1496
1515
  range.grid.strokeOpacity = 1;
1497
1516
  }
@@ -1509,11 +1528,11 @@
1509
1528
  dateAxis.renderer.ticks.template.length = 10;
1510
1529
  dateAxis.renderer.ticks.template.location = 0;
1511
1530
  }
1512
- dateAxis.renderer.minGridDistance = (_f = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _f !== void 0 ? _f : 50;
1531
+ dateAxis.renderer.minGridDistance = (_d = settings === null || settings === void 0 ? void 0 : settings.MinGridDistance) !== null && _d !== void 0 ? _d : 50;
1513
1532
  dateAxis.renderer.grid.template.location = 0;
1514
1533
  dateAxis.minZoomCount = 5;
1515
1534
  dateAxis.groupData = dataShouldBeGrouped;
1516
- dateAxis.groupCount = (_g = settings.DataGroupBucketSize) !== null && _g !== void 0 ? _g : this.DataGroupBucketSize;
1535
+ dateAxis.groupCount = (_e = settings.DataGroupBucketSize) !== null && _e !== void 0 ? _e : this.DataGroupBucketSize;
1517
1536
  //Se ho almeno una serie ad intervallo e i settings non mi impediscono esplicitamente di usare i gaps, visualizzo i dati col gap
1518
1537
  if (gapsAllowed) {
1519
1538
  if (!seriesWithInterval) {
@@ -1652,17 +1671,17 @@
1652
1671
  });
1653
1672
  if (settings.Legend) {
1654
1673
  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';
1674
+ this.ChartInstance.legend.position = (_f = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _f !== void 0 ? _f : 'right';
1656
1675
  this.ChartInstance.legend.scrollable = true;
1657
1676
  this.ChartInstance.legend.itemContainers.template.tooltipText = "{name}";
1658
1677
  this.ChartInstance.legend.itemContainers.template.events.on("over", function (event) { _this.processOver(event.target.dataItem.dataContext); });
1659
1678
  this.ChartInstance.legend.itemContainers.template.events.on("out", function () { _this.processOut(); });
1660
1679
  if (settings.LegendPadding) {
1661
1680
  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;
1681
+ template.paddingTop = (_g = settings.LegendPadding.top) !== null && _g !== void 0 ? _g : 0;
1682
+ template.paddingBottom = (_h = settings.LegendPadding.bottom) !== null && _h !== void 0 ? _h : 0;
1683
+ template.paddingLeft = (_j = settings.LegendPadding.left) !== null && _j !== void 0 ? _j : 0;
1684
+ template.paddingRight = (_k = settings.LegendPadding.right) !== null && _k !== void 0 ? _k : 0;
1666
1685
  }
1667
1686
  }
1668
1687
  this.ChartInstance.cursor = new am4charts__namespace.XYCursor();