mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-05 21:38:25 +00:00
Add title to donut chart and media queries
This commit is contained in:
parent
e5b85ff1a0
commit
933a57af7a
@ -1,8 +1,8 @@
|
|||||||
<div class="{{elevation}} tui-card">
|
<div class="{{elevation}} tui-card">
|
||||||
<div class="tui-card-title">Devices</div>
|
<div class="tui-card-title">{{title}}</div>
|
||||||
<div class="tui-card-content">
|
<div class="tui-card-content">
|
||||||
<div fxLayout="row" fxLayoutAlign="space-between stretch">
|
<div fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||||
<app-donut-chart [elementID]="chartID" fxFlex="30"></app-donut-chart>
|
<app-donut-chart [elementID]="chartID" fxFlex="30" [title]="title"></app-donut-chart>
|
||||||
<div class="items" fxLayout="column" fxLayoutAlign="start end" fxFlex="70">
|
<div class="items" fxLayout="column" fxLayoutAlign="start end" fxFlex="70">
|
||||||
<app-chart-item *ngFor="let state of states" [state]="state.label" [count]="state.count">
|
<app-chart-item *ngFor="let state of states" [state]="state.label" [count]="state.count">
|
||||||
</app-chart-item>
|
</app-chart-item>
|
||||||
|
@ -14,6 +14,7 @@ export class DeviceChartComponent implements OnInit {
|
|||||||
chartID: string = 'devicesChart';
|
chartID: string = 'devicesChart';
|
||||||
elevation: string = cardElevation;
|
elevation: string = cardElevation;
|
||||||
states: { label: string, count: number, color: string }[] = [];
|
states: { label: string, count: number, color: string }[] = [];
|
||||||
|
title: string = "Devices";
|
||||||
|
|
||||||
constructor(private deviceService: DeviceService) { }
|
constructor(private deviceService: DeviceService) { }
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
<div class="chart-container" fxLayout="column" fxLayoutAlign="space-around">
|
<div class="chart-container">
|
||||||
<canvas id={{elementID}} width="100px" height="100px"></canvas>
|
<canvas id={{elementID}} width="100px" height="100px"></canvas>
|
||||||
<div class="center">{{count}}</div>
|
<div class="center" fxLayout="column" fxLayoutAlign="center center">
|
||||||
|
<div class="count">{{count}}</div>
|
||||||
|
<div class="title">{{title}}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
@ -6,9 +6,38 @@
|
|||||||
|
|
||||||
.center {
|
.center {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
top: 0; left: 0; bottom: 0; right: 0;
|
||||||
top: 40%;
|
width: 50%;
|
||||||
width: 100%;
|
height: 50%;
|
||||||
text-align: center;
|
overflow: auto;
|
||||||
font-size:1.8rem;
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.count {
|
||||||
|
font-size: calc(1rem + 0.625vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: calc(0.5rem + 0.625vw);
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
@media (min-width: 640px) and (max-width: 1000px) {
|
||||||
|
.title {
|
||||||
|
display:none;
|
||||||
|
font-size: calc(0.35rem + 0.625vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
.count {
|
||||||
|
font-size: calc(1.35rem + 0.625vw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width:1000px) {
|
||||||
|
.title {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
}
|
}
|
@ -9,6 +9,7 @@ import { tooltip } from '../tooltip'
|
|||||||
})
|
})
|
||||||
export class DonutChartComponent {
|
export class DonutChartComponent {
|
||||||
@Input() elementID: string;
|
@Input() elementID: string;
|
||||||
|
@Input() title: number;
|
||||||
count: number;
|
count: number;
|
||||||
|
|
||||||
private canvas: any;
|
private canvas: any;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<div class="{{elevation}} tui-card">
|
<div class="{{elevation}} tui-card">
|
||||||
<div class="tui-card-title">Folders</div>
|
<div class="tui-card-title">{{title}}</div>
|
||||||
<div class="tui-card-content">
|
<div class="tui-card-content">
|
||||||
<div fxLayout="row" fxLayoutAlign="space-between stretch">
|
<div fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||||
<app-donut-chart [elementID]="chartID" fxFlex="30"></app-donut-chart>
|
<app-donut-chart [elementID]="chartID" fxFlex="30" [title]="title"></app-donut-chart>
|
||||||
<div class="items" fxLayout="column" fxLayoutAlign="start end" fxFlex="70">
|
<div class="items" fxLayout="column" fxLayoutAlign="start end" fxFlex="70">
|
||||||
<app-chart-item *ngFor="let state of states" [state]="state.label" [count]="state.count">
|
<app-chart-item *ngFor="let state of states" [state]="state.label" [count]="state.count">
|
||||||
</app-chart-item>
|
</app-chart-item>
|
||||||
|
@ -14,6 +14,7 @@ export class FolderChartComponent implements OnInit {
|
|||||||
chartID: string = 'foldersChart';
|
chartID: string = 'foldersChart';
|
||||||
states: { label: string, count: number, color: string }[] = [];
|
states: { label: string, count: number, color: string }[] = [];
|
||||||
elevation: string = cardElevation;
|
elevation: string = cardElevation;
|
||||||
|
title: string = "Folders";
|
||||||
|
|
||||||
constructor(private folderService: FolderService) { }
|
constructor(private folderService: FolderService) { }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user