@esfaenza/es-charts 20.3.9 → 20.3.12

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.
@@ -1302,6 +1302,8 @@ class LineChartService {
1302
1302
  getTooltipText(source, index, interval, finalInstant) {
1303
1303
  if (!this.singleDataSet)
1304
1304
  return source.name ? "{name}: [bold]{valueY}[/]" : "[bold]{valueY}[/]";
1305
+ //Capire perché questo formatdate funziona malissimo
1306
+ debugger;
1305
1307
  let text = "[bold]{valueX.formatDate()}[/]\n";
1306
1308
  this.currentSeriesData.series.forEach((serie, sindex) => {
1307
1309
  let uom = serie.uom ? " [fontStyle: italic]" + serie.uom + "[/]" : "";
@@ -1412,21 +1414,118 @@ class LineChartService {
1412
1414
  }
1413
1415
  /** @ignore */
1414
1416
  getGridIntervals(baseTimeUnit) {
1415
- if (baseTimeUnit == "hour") {
1416
- return [
1417
- { timeUnit: "hour", count: 1 },
1418
- { timeUnit: "hour", count: 3 },
1419
- { timeUnit: "hour", count: 6 },
1420
- { timeUnit: "hour", count: 12 },
1421
- { timeUnit: "day", count: 1 },
1422
- { timeUnit: "day", count: 2 },
1423
- { timeUnit: "day", count: 3 },
1424
- { timeUnit: "week", count: 1 },
1425
- { timeUnit: "month", count: 1 },
1426
- { timeUnit: "year", count: 1 }
1427
- ];
1417
+ switch (baseTimeUnit) {
1418
+ case "millisecond":
1419
+ return [
1420
+ { timeUnit: "millisecond", count: 1 },
1421
+ { timeUnit: "millisecond", count: 5 },
1422
+ { timeUnit: "millisecond", count: 10 },
1423
+ { timeUnit: "millisecond", count: 50 },
1424
+ { timeUnit: "millisecond", count: 100 },
1425
+ { timeUnit: "millisecond", count: 500 },
1426
+ { timeUnit: "second", count: 1 },
1427
+ { timeUnit: "second", count: 5 },
1428
+ { timeUnit: "second", count: 10 },
1429
+ { timeUnit: "second", count: 30 },
1430
+ { timeUnit: "minute", count: 1 },
1431
+ { timeUnit: "minute", count: 5 },
1432
+ { timeUnit: "minute", count: 10 },
1433
+ { timeUnit: "minute", count: 30 },
1434
+ { timeUnit: "hour", count: 1 },
1435
+ { timeUnit: "hour", count: 3 },
1436
+ { timeUnit: "hour", count: 6 },
1437
+ { timeUnit: "hour", count: 12 },
1438
+ { timeUnit: "day", count: 1 },
1439
+ { timeUnit: "day", count: 2 },
1440
+ { timeUnit: "day", count: 3 },
1441
+ { timeUnit: "week", count: 1 },
1442
+ { timeUnit: "month", count: 1 },
1443
+ { timeUnit: "year", count: 1 }
1444
+ ];
1445
+ case "second":
1446
+ return [
1447
+ { timeUnit: "second", count: 1 },
1448
+ { timeUnit: "second", count: 5 },
1449
+ { timeUnit: "second", count: 10 },
1450
+ { timeUnit: "second", count: 30 },
1451
+ { timeUnit: "minute", count: 1 },
1452
+ { timeUnit: "minute", count: 5 },
1453
+ { timeUnit: "minute", count: 10 },
1454
+ { timeUnit: "minute", count: 30 },
1455
+ { timeUnit: "hour", count: 1 },
1456
+ { timeUnit: "hour", count: 3 },
1457
+ { timeUnit: "hour", count: 6 },
1458
+ { timeUnit: "hour", count: 12 },
1459
+ { timeUnit: "day", count: 1 },
1460
+ { timeUnit: "day", count: 2 },
1461
+ { timeUnit: "day", count: 3 },
1462
+ { timeUnit: "week", count: 1 },
1463
+ { timeUnit: "month", count: 1 },
1464
+ { timeUnit: "year", count: 1 }
1465
+ ];
1466
+ case "minute":
1467
+ return [
1468
+ { timeUnit: "minute", count: 1 },
1469
+ { timeUnit: "minute", count: 5 },
1470
+ { timeUnit: "minute", count: 10 },
1471
+ { timeUnit: "minute", count: 30 },
1472
+ { timeUnit: "hour", count: 1 },
1473
+ { timeUnit: "hour", count: 3 },
1474
+ { timeUnit: "hour", count: 6 },
1475
+ { timeUnit: "hour", count: 12 },
1476
+ { timeUnit: "day", count: 1 },
1477
+ { timeUnit: "day", count: 2 },
1478
+ { timeUnit: "day", count: 3 },
1479
+ { timeUnit: "week", count: 1 },
1480
+ { timeUnit: "month", count: 1 },
1481
+ { timeUnit: "year", count: 1 }
1482
+ ];
1483
+ case "hour":
1484
+ return [
1485
+ { timeUnit: "hour", count: 1 },
1486
+ { timeUnit: "hour", count: 3 },
1487
+ { timeUnit: "hour", count: 6 },
1488
+ { timeUnit: "hour", count: 12 },
1489
+ { timeUnit: "day", count: 1 },
1490
+ { timeUnit: "day", count: 2 },
1491
+ { timeUnit: "day", count: 3 },
1492
+ { timeUnit: "week", count: 1 },
1493
+ { timeUnit: "month", count: 1 },
1494
+ { timeUnit: "year", count: 1 }
1495
+ ];
1496
+ case "day":
1497
+ return [
1498
+ { timeUnit: "day", count: 1 },
1499
+ { timeUnit: "day", count: 2 },
1500
+ { timeUnit: "day", count: 3 },
1501
+ { timeUnit: "week", count: 1 },
1502
+ { timeUnit: "month", count: 1 },
1503
+ { timeUnit: "year", count: 1 }
1504
+ ];
1505
+ case "week":
1506
+ return [
1507
+ { timeUnit: "week", count: 1 },
1508
+ { timeUnit: "week", count: 2 },
1509
+ { timeUnit: "month", count: 1 },
1510
+ { timeUnit: "month", count: 3 },
1511
+ { timeUnit: "year", count: 1 }
1512
+ ];
1513
+ case "month":
1514
+ return [
1515
+ { timeUnit: "month", count: 1 },
1516
+ { timeUnit: "month", count: 2 },
1517
+ { timeUnit: "month", count: 3 },
1518
+ { timeUnit: "month", count: 6 },
1519
+ { timeUnit: "year", count: 1 }
1520
+ ];
1521
+ case "year":
1522
+ return [
1523
+ { timeUnit: "year", count: 1 },
1524
+ { timeUnit: "year", count: 2 },
1525
+ { timeUnit: "year", count: 5 },
1526
+ { timeUnit: "year", count: 10 }
1527
+ ];
1428
1528
  }
1429
- return undefined;
1430
1529
  }
1431
1530
  /** @ignore */
1432
1531
  getTooltipDateFormat(baseTimeUnit) {