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
@@ -51,16 +51,20 @@
[routerLink]="['app',address.value]"></button> [routerLink]="['app',address.value]"></button>
</div> </div>
<div class="text-right">Uptime: {{uptime$ | async | dateAgo}}</div>
</div> </div>
</div> </div>
<div class="col-12"> <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>
</div> </div>
@@ -38,6 +38,7 @@ export class SplashComponent {
this.chartData$ = this.appService.getInfoChart().pipe( this.chartData$ = this.appService.getInfoChart().pipe(
map((chartData: any) => { map((chartData: any) => {
return { return {
labels: chartData.map((d: any) => d.label), labels: chartData.map((d: any) => d.label),
datasets: [ datasets: [
{ {
@@ -66,6 +67,7 @@ export class SplashComponent {
this.chartOptions = { this.chartOptions = {
maintainAspectRatio: false,
plugins: { plugins: {
legend: { legend: {
labels: { labels: {
+6
View File
@@ -9,4 +9,10 @@
.p-datatable.p-datatable-hoverable-rows .p-datatable-tbody>tr:not(.p-highlight) { .p-datatable.p-datatable-hoverable-rows .p-datatable-tbody>tr:not(.p-highlight) {
cursor: pointer; cursor: pointer;
}
p-chart>div {
position: relative;
min-height: 40vh;
} }