@esfaenza/es-charts 15.2.7 → 15.2.9
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/esm2020/lib/services/AreaChartService.mjs +22 -2
- package/esm2020/lib/services/LineChartService.mjs +22 -2
- package/esm2020/lib/services/PieChartService.mjs +2 -2
- package/fesm2015/esfaenza-es-charts.mjs +43 -3
- package/fesm2015/esfaenza-es-charts.mjs.map +1 -1
- package/fesm2020/esfaenza-es-charts.mjs +43 -3
- package/fesm2020/esfaenza-es-charts.mjs.map +1 -1
- package/lib/services/AreaChartService.d.ts +1 -0
- package/lib/services/LineChartService.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1220,7 +1220,7 @@ class LineChartService {
|
|
|
1220
1220
|
console.error("Per utilizzare la funzionalità dei gap è obbligatorio definire un intervallo nelle serie del grafico");
|
|
1221
1221
|
return null;
|
|
1222
1222
|
}
|
|
1223
|
-
dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
|
|
1223
|
+
dateAxis.baseInterval = { count: interval.count, timeUnit: this.fixTimeUnit(interval.timeunit) };
|
|
1224
1224
|
}
|
|
1225
1225
|
if (showTimeline)
|
|
1226
1226
|
ChartInstanceCasted.scrollbarX = new am4charts.XYChartScrollbar();
|
|
@@ -1369,6 +1369,26 @@ class LineChartService {
|
|
|
1369
1369
|
dateAxis.events.on("endchanged", t => this.emitSelectionChanged(t, settings));
|
|
1370
1370
|
return this;
|
|
1371
1371
|
}
|
|
1372
|
+
fixTimeUnit(tu) {
|
|
1373
|
+
if (tu === 0)
|
|
1374
|
+
return "millisecond";
|
|
1375
|
+
else if (tu === 1)
|
|
1376
|
+
return "second";
|
|
1377
|
+
else if (tu === 2)
|
|
1378
|
+
return "minute";
|
|
1379
|
+
else if (tu === 3)
|
|
1380
|
+
return "hour";
|
|
1381
|
+
else if (tu === 4)
|
|
1382
|
+
return "day";
|
|
1383
|
+
else if (tu === 5)
|
|
1384
|
+
return "week";
|
|
1385
|
+
else if (tu === 6)
|
|
1386
|
+
return "month";
|
|
1387
|
+
else if (tu === 7)
|
|
1388
|
+
return "year";
|
|
1389
|
+
else
|
|
1390
|
+
return tu;
|
|
1391
|
+
}
|
|
1372
1392
|
/** @ignore */
|
|
1373
1393
|
setSelection(from, to) {
|
|
1374
1394
|
this.dateAxis.zoomToDates(from, to, true, true);
|
|
@@ -1489,7 +1509,7 @@ class PieChartService {
|
|
|
1489
1509
|
//Per evitare di dimenticarmeli e gestire comunque bene gli ngif ecc...
|
|
1490
1510
|
am4core.options.autoDispose = true;
|
|
1491
1511
|
this.ChartInstance = am4core.create(settings.Name, settings.Mode3D ? am4charts.PieChart3D : am4charts.PieChart);
|
|
1492
|
-
this.ChartInstance.innerRadius = ((settings.DonutRadiusPercentage
|
|
1512
|
+
this.ChartInstance.innerRadius = ((isNaN(settings.DonutRadiusPercentage) ? 15 : settings.DonutRadiusPercentage) / 100) * settings.ContainerHeight;
|
|
1493
1513
|
let series = this.ChartInstance.series.push(settings.Mode3D ? new am4charts.PieSeries3D() : new am4charts.PieSeries());
|
|
1494
1514
|
series.dataFields.value = "v";
|
|
1495
1515
|
series.dataFields.category = "k";
|
|
@@ -2041,7 +2061,7 @@ class AreaChartService {
|
|
|
2041
2061
|
dateAxis.renderer.ticks.template.location = 0;
|
|
2042
2062
|
}
|
|
2043
2063
|
if (!!interval)
|
|
2044
|
-
dateAxis.baseInterval = { count: interval.count, timeUnit: interval.timeunit };
|
|
2064
|
+
dateAxis.baseInterval = { count: interval.count, timeUnit: this.fixTimeUnit(interval.timeunit) };
|
|
2045
2065
|
// Unisco il dataset e tiro fuori i dati
|
|
2046
2066
|
let chartData = [];
|
|
2047
2067
|
let seriesToMakeCache = {};
|
|
@@ -2068,6 +2088,26 @@ class AreaChartService {
|
|
|
2068
2088
|
dateAxis.events.on("endchanged", t => this.emitSelectionChanged(t, settings));
|
|
2069
2089
|
return this;
|
|
2070
2090
|
}
|
|
2091
|
+
fixTimeUnit(tu) {
|
|
2092
|
+
if (tu === 0)
|
|
2093
|
+
return "millisecond";
|
|
2094
|
+
else if (tu === 1)
|
|
2095
|
+
return "second";
|
|
2096
|
+
else if (tu === 2)
|
|
2097
|
+
return "minute";
|
|
2098
|
+
else if (tu === 3)
|
|
2099
|
+
return "hour";
|
|
2100
|
+
else if (tu === 4)
|
|
2101
|
+
return "day";
|
|
2102
|
+
else if (tu === 5)
|
|
2103
|
+
return "week";
|
|
2104
|
+
else if (tu === 6)
|
|
2105
|
+
return "month";
|
|
2106
|
+
else if (tu === 7)
|
|
2107
|
+
return "year";
|
|
2108
|
+
else
|
|
2109
|
+
return tu;
|
|
2110
|
+
}
|
|
2071
2111
|
/** @ignore */
|
|
2072
2112
|
setSelection(from, to) {
|
|
2073
2113
|
}
|