fixed chart sizing

This commit is contained in:
Ben Wilson 2023-08-06 17:43:14 -04:00
parent 09ba050849
commit 1516f90712
3 changed files with 16 additions and 4 deletions

View File

@ -51,16 +51,20 @@
[routerLink]="['app',address.value]"></button>
</div>
<div class="text-right">Uptime: {{uptime$ | async | dateAgo}}</div>
</div>
</div>
<div class="col-12">
<div *ngIf="chartData$ | async as chartData">
<div class="card">
<p-chart type="line" [data]="chartData" [options]="chartOptions"></p-chart>
<div *ngIf="chartData$ | async as chartData">
<div class="card chart">
<div class="text-center mb-2">Uptime: {{uptime$ | async | dateAgo}}</div>
<p-chart [responsive]="true" type="line" [data]="chartData" [options]="chartOptions"></p-chart>
</div>
</div>

View File

@ -38,6 +38,7 @@ export class SplashComponent {
this.chartData$ = this.appService.getInfoChart().pipe(
map((chartData: any) => {
return {
labels: chartData.map((d: any) => d.label),
datasets: [
{
@ -66,6 +67,7 @@ export class SplashComponent {
this.chartOptions = {
maintainAspectRatio: false,
plugins: {
legend: {
labels: {

View File

@ -9,4 +9,10 @@
.p-datatable.p-datatable-hoverable-rows .p-datatable-tbody>tr:not(.p-highlight) {
cursor: pointer;
}
p-chart>div {
position: relative;
min-height: 40vh;
}