@esfaenza/es-charts 11.2.29 → 11.2.30

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.
@@ -1676,15 +1676,8 @@
1676
1676
  var seriesToPush = [];
1677
1677
  var seriesColors = [];
1678
1678
  var defaultIndex = 0;
1679
- //-- Generazione di un unico dataset invece che N, per poter gestire un unico tooltip
1680
- if (this.singleDataSet) {
1681
- this.ChartInstance.data = this.generateSingleDataset(dataConverted);
1682
- ;
1683
- dateAxis.cursorTooltipEnabled = false;
1684
- }
1685
- //-- Fine generazione
1686
- dataConverted.series.forEach(function (s, index) {
1687
- var _a, _b, _c;
1679
+ // Ordinamento dei dati se serve
1680
+ dataConverted.series.forEach(function (s) {
1688
1681
  if (s.values[0] && !(s.values[0].d instanceof Date)) {
1689
1682
  for (var v = 0; v < s.values.length; v++)
1690
1683
  s.values[v].d = new Date(s.values[v].d);
@@ -1701,6 +1694,15 @@
1701
1694
  }
1702
1695
  if (!correctOrder)
1703
1696
  s.values.sort(function (d1, d2) { return d1.d.getTime() - d2.d.getTime(); });
1697
+ });
1698
+ // Generazione di un unico dataset invece che N, per poter gestire un unico tooltip
1699
+ if (this.singleDataSet) {
1700
+ this.ChartInstance.data = this.generateSingleDataset(dataConverted);
1701
+ ;
1702
+ dateAxis.cursorTooltipEnabled = false;
1703
+ }
1704
+ dataConverted.series.forEach(function (s, index) {
1705
+ var _a, _b, _c;
1704
1706
  var fill = s.fill != null && s.fill != undefined ? s.fill : ((_a = settings === null || settings === void 0 ? void 0 : settings.Fill) !== null && _a !== void 0 ? _a : false);
1705
1707
  var series = (settings === null || settings === void 0 ? void 0 : settings.Step) ? new am4charts__namespace.StepLineSeries() : new am4charts__namespace.LineSeries();
1706
1708
  series.dataFields.valueY = "v" + (_this.singleDataSet ? index : "");
@@ -1726,7 +1728,7 @@
1726
1728
  series.tooltip.hiddenState.transitionDuration = 0;
1727
1729
  //Utilizzo il mio dateService per la formattazione della data in modo che non debba mai gestire n formati fra n librerie... bellissimo
1728
1730
  series.dateFormatter.format = function (source) {
1729
- if (interval && finalInstant) {
1731
+ if (interval && finalInstant && ["hour", "minute", "second"].includes(interval.timeunit)) {
1730
1732
  var timepart = null;
1731
1733
  switch (interval.timeunit) {
1732
1734
  case "hour":
@@ -1743,7 +1745,7 @@
1743
1745
  return _this.dateExts.adjustDateToFinalInstant(source, timepart, interval ? interval.timeunit == "second" : false);
1744
1746
  }
1745
1747
  else
1746
- return _this.dateExts.getFormatted(source, false, interval ? interval.timeunit == "second" : false);
1748
+ return _this.dateExts.getFormatted(source, interval ? ["day", "week", "month", "year"].includes(interval.timeunit) : false, interval ? interval.timeunit == "second" : false);
1747
1749
  };
1748
1750
  series.adapter.add("tooltipText", function () {
1749
1751
  var text = "[bold]{dateX.formatDate()}[/]\n";