@forgeroute/ui 0.3.3 → 0.3.4
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.
|
@@ -10560,7 +10560,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10560
10560
|
}]
|
|
10561
10561
|
}
|
|
10562
10562
|
});
|
|
10563
|
-
|
|
10563
|
+
let registered = false;
|
|
10564
|
+
function registerChartParts() {
|
|
10565
|
+
if (registered) return;
|
|
10566
|
+
Chart.register(BarController, BarElement, CategoryScale, LinearScale, Tooltip);
|
|
10567
|
+
registered = true;
|
|
10568
|
+
}
|
|
10564
10569
|
const VALUE_LABELS = {
|
|
10565
10570
|
id: "uiBarChartValueLabels",
|
|
10566
10571
|
afterDatasetsDraw(chart) {
|
|
@@ -10606,53 +10611,56 @@ var BarChartComponent = class BarChartComponent {
|
|
|
10606
10611
|
effect(() => {
|
|
10607
10612
|
const s = this.series();
|
|
10608
10613
|
const canvas = this.canvas().nativeElement;
|
|
10609
|
-
if (!this.chart)
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
responsive: true,
|
|
10624
|
-
maintainAspectRatio: false,
|
|
10625
|
-
animation: false,
|
|
10626
|
-
layout: { padding: { top: 20 } },
|
|
10627
|
-
plugins: {
|
|
10628
|
-
legend: { display: false },
|
|
10629
|
-
tooltip: { callbacks: { label: (item) => this.tooltipText(Number(item.raw)) } }
|
|
10614
|
+
if (!this.chart) {
|
|
10615
|
+
registerChartParts();
|
|
10616
|
+
this.zone.runOutsideAngular(() => {
|
|
10617
|
+
this.chart = new Chart(canvas, {
|
|
10618
|
+
type: "bar",
|
|
10619
|
+
data: {
|
|
10620
|
+
labels: s.labels,
|
|
10621
|
+
datasets: [{
|
|
10622
|
+
data: s.data,
|
|
10623
|
+
backgroundColor: s.color,
|
|
10624
|
+
hoverBackgroundColor: s.hoverColor,
|
|
10625
|
+
borderRadius: 3,
|
|
10626
|
+
borderSkipped: false
|
|
10627
|
+
}]
|
|
10630
10628
|
},
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
}
|
|
10639
|
-
grid: { color: "#e2e8f0" },
|
|
10640
|
-
border: { display: false }
|
|
10629
|
+
options: {
|
|
10630
|
+
responsive: true,
|
|
10631
|
+
maintainAspectRatio: false,
|
|
10632
|
+
animation: false,
|
|
10633
|
+
layout: { padding: { top: 20 } },
|
|
10634
|
+
plugins: {
|
|
10635
|
+
legend: { display: false },
|
|
10636
|
+
tooltip: { callbacks: { label: (item) => this.tooltipText(Number(item.raw)) } }
|
|
10641
10637
|
},
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10638
|
+
scales: {
|
|
10639
|
+
y: {
|
|
10640
|
+
beginAtZero: true,
|
|
10641
|
+
ticks: {
|
|
10642
|
+
precision: 0,
|
|
10643
|
+
color: "#94a3b8",
|
|
10644
|
+
font: { size: 11 }
|
|
10645
|
+
},
|
|
10646
|
+
grid: { color: "#e2e8f0" },
|
|
10647
|
+
border: { display: false }
|
|
10648
10648
|
},
|
|
10649
|
-
|
|
10649
|
+
x: {
|
|
10650
|
+
grid: { display: false },
|
|
10651
|
+
ticks: {
|
|
10652
|
+
maxRotation: 0,
|
|
10653
|
+
color: "#94a3b8",
|
|
10654
|
+
font: { size: 10 }
|
|
10655
|
+
},
|
|
10656
|
+
border: { display: false }
|
|
10657
|
+
}
|
|
10650
10658
|
}
|
|
10651
|
-
}
|
|
10652
|
-
|
|
10653
|
-
|
|
10659
|
+
},
|
|
10660
|
+
plugins: [VALUE_LABELS]
|
|
10661
|
+
});
|
|
10654
10662
|
});
|
|
10655
|
-
}
|
|
10663
|
+
}
|
|
10656
10664
|
const chart = this.chart;
|
|
10657
10665
|
chart.data.labels = s.labels;
|
|
10658
10666
|
const ds = chart.data.datasets[0];
|