@esfaenza/es-charts 11.2.31 → 11.2.33

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.
@@ -153,7 +153,7 @@
153
153
  /**
154
154
  * Costruttore
155
155
  *
156
- * @param {KeyValue[]} values Lista di Chiave-Valore che rappresentano ognuno una colonna
156
+ * @param {KeyValueColor[]} values Lista di Chiave-Valore-Colore che rappresentano ognuno una colonna
157
157
  */
158
158
  function VerticalChartData(values) {
159
159
  if (values === void 0) { values = []; }
@@ -642,10 +642,11 @@
642
642
  */
643
643
  var KeyValueColor = /** @class */ (function () {
644
644
  /** @ignore */
645
- function KeyValueColor(k, v, c) {
645
+ function KeyValueColor(k, v, c, t) {
646
646
  this.k = k;
647
647
  this.v = v;
648
648
  this.c = c;
649
+ this.t = t;
649
650
  }
650
651
  return KeyValueColor;
651
652
  }());
@@ -2066,6 +2067,7 @@
2066
2067
  var ChartInstanceCasted = this.ChartInstance;
2067
2068
  var dataConverted = this.Adapter ? this.Adapter.adaptDataForVerticalChart(data) : data;
2068
2069
  ChartInstanceCasted.data = dataConverted.values;
2070
+ var noStrokes = dataConverted.values.some(function (t) { return !!t.c; });
2069
2071
  if (settings.Legend) {
2070
2072
  ChartInstanceCasted.legend = new am4charts__namespace.Legend();
2071
2073
  ChartInstanceCasted.legend.position = (_a = settings === null || settings === void 0 ? void 0 : settings.LegendPosition) !== null && _a !== void 0 ? _a : 'right';
@@ -2122,12 +2124,19 @@
2122
2124
  series.dataFields.valueY = "v";
2123
2125
  series.dataFields.categoryX = "k";
2124
2126
  series.name = "";
2125
- series.columns.template.tooltipText = "{categoryX}: [bold]{valueY}[/]";
2126
- series.columns.template.fillOpacity = .8;
2127
- series.columns.template.width = am4core__namespace.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
2128
2127
  var columnTemplate = series.columns.template;
2129
- columnTemplate.strokeWidth = 2;
2130
- columnTemplate.strokeOpacity = 1;
2128
+ columnTemplate.tooltipText = "{categoryX}: [bold]{valueY}[/] {t}";
2129
+ columnTemplate.fillOpacity = .8;
2130
+ columnTemplate.width = am4core__namespace.percent((_h = settings.ColumnWidthPercentage) !== null && _h !== void 0 ? _h : this.DefaultColumnWidthPercentage);
2131
+ if (noStrokes) {
2132
+ columnTemplate.strokeOpacity = 0;
2133
+ columnTemplate.strokeWidth = 0;
2134
+ columnTemplate.adapter.add("fill", function (_, target) { return am4core__namespace.color(target.dataItem.dataContext.c); });
2135
+ }
2136
+ else {
2137
+ columnTemplate.strokeWidth = 2;
2138
+ columnTemplate.strokeOpacity = 1;
2139
+ }
2131
2140
  return this;
2132
2141
  };
2133
2142
  /** @ignore */