@esfaenza/es-charts 11.2.32 → 11.2.34
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.
- package/bundles/esfaenza-es-charts.umd.js +20 -11
- package/bundles/esfaenza-es-charts.umd.js.map +1 -1
- package/bundles/esfaenza-es-charts.umd.min.js +1 -1
- package/bundles/esfaenza-es-charts.umd.min.js.map +1 -1
- package/esfaenza-es-charts.metadata.json +1 -1
- package/esm2015/lib/models/data/Vertical2DChartData.js +2 -2
- package/esm2015/lib/models/data/VerticalChartData.js +2 -2
- package/esm2015/lib/models/data/VerticalStackedChartData.js +2 -2
- package/esm2015/lib/models/data/base/KeyValueColor.js +3 -2
- package/esm2015/lib/services/LineChartService.js +3 -3
- package/esm2015/lib/services/VerticalChartService.js +14 -6
- package/fesm2015/esfaenza-es-charts.js +20 -11
- package/fesm2015/esfaenza-es-charts.js.map +1 -1
- package/lib/models/data/Vertical2DChartData.d.ts +3 -1
- package/lib/models/data/VerticalChartData.d.ts +4 -4
- package/lib/models/data/VerticalStackedChartData.d.ts +3 -1
- package/lib/models/data/base/KeyValueColor.d.ts +2 -1
- package/package.json +1 -1
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
/**
|
|
136
136
|
* Costruttore
|
|
137
137
|
*
|
|
138
|
-
* @param {{ name: string; values: KeyValue[]
|
|
138
|
+
* @param {{ name: string; values: KeyValue[];, uom: string }[]} groups Gruppi di valori raggruppati per nome
|
|
139
139
|
* @param {{ color: string }[]} colorinfos Lista dei colori da utilizzare. Vanno a sovrascrivere quelli di default di amcharts
|
|
140
140
|
*/
|
|
141
141
|
function Vertical2DChartData(groups, colorinfos) {
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
/**
|
|
154
154
|
* Costruttore
|
|
155
155
|
*
|
|
156
|
-
* @param {
|
|
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 = []; }
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
/**
|
|
170
170
|
* Costruttore
|
|
171
171
|
*
|
|
172
|
-
* @param {{ name: string; values: KeyValue[]
|
|
172
|
+
* @param {{ name: string; values: KeyValue[], uom: string }[]} groups Gruppi di valori raggruppati per nome
|
|
173
173
|
*/
|
|
174
174
|
function VerticalStackedChartData(groups) {
|
|
175
175
|
if (groups === void 0) { groups = []; }
|
|
@@ -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
|
}());
|
|
@@ -1707,7 +1708,7 @@
|
|
|
1707
1708
|
var series = (settings === null || settings === void 0 ? void 0 : settings.Step) ? new am4charts__namespace.StepLineSeries() : new am4charts__namespace.LineSeries();
|
|
1708
1709
|
series.dataFields.valueY = "v" + (_this.singleDataSet ? index : "");
|
|
1709
1710
|
series.dataFields.dateX = "d";
|
|
1710
|
-
series.
|
|
1711
|
+
series.measureUnit = s.uom;
|
|
1711
1712
|
series.name = s.name;
|
|
1712
1713
|
series.strokeWidth = (_b = settings === null || settings === void 0 ? void 0 : settings.StrokeSize) !== null && _b !== void 0 ? _b : 1;
|
|
1713
1714
|
series.connect = !gapsAllowed;
|
|
@@ -1750,7 +1751,7 @@
|
|
|
1750
1751
|
series.adapter.add("tooltipText", function () {
|
|
1751
1752
|
var text = "[bold]{dateX.formatDate()}[/]\n";
|
|
1752
1753
|
_this.ChartInstance.series.each(function (item) {
|
|
1753
|
-
var uom = " [font-style: italic]" + series.
|
|
1754
|
+
var uom = " [font-style: italic]" + series.measureUnit || "" + "[/]";
|
|
1754
1755
|
text += "[" + item.stroke.hex + "]●[/] " + (item.name ? (item.name + ": ") : "") + "[bold]{" + item.dataFields.valueY + "}[/]" + uom + "\n";
|
|
1755
1756
|
});
|
|
1756
1757
|
return text;
|
|
@@ -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.
|
|
2130
|
-
columnTemplate.
|
|
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 */
|