chart apply test
This commit is contained in:
parent
cc662367bd
commit
48d038610e
|
@ -1,3 +1,9 @@
|
|||
<p>
|
||||
app-summary-card works!
|
||||
</p>
|
||||
<div class="mat-elevation-z4 ">
|
||||
<mat-toolbar>
|
||||
<mat-toolbar-row>
|
||||
<span>Applications</span>
|
||||
</mat-toolbar-row>
|
||||
</mat-toolbar>
|
||||
<ngx-charts-advanced-pie-chart [view]="view" [scheme]="colorScheme" [results]="data" [gradient]="gradient" (select)="onSelect($event)">
|
||||
</ngx-charts-advanced-pie-chart>
|
||||
</div>
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { data } from './data';
|
||||
|
||||
@Component({
|
||||
selector: 'of-app-summary-card',
|
||||
|
@ -7,7 +8,19 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class AppSummaryCardComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
view: any[] = [440, 180];
|
||||
|
||||
colorScheme = {
|
||||
domain: ['#5AA454', '#C7B42C', '#A10A28']
|
||||
};
|
||||
|
||||
constructor() {
|
||||
Object.assign(this, { data });
|
||||
}
|
||||
|
||||
onSelect(event) {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
|
14
src/app/commons/component/app-summary-card/data.ts
Normal file
14
src/app/commons/component/app-summary-card/data.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
export const data = [
|
||||
{
|
||||
'name': 'Up',
|
||||
'value': 125
|
||||
},
|
||||
{
|
||||
'name': 'Warning',
|
||||
'value': 80
|
||||
},
|
||||
{
|
||||
'name': 'Down',
|
||||
'value': 9
|
||||
}
|
||||
];
|
14
src/app/commons/component/host-summary-card/data.ts
Normal file
14
src/app/commons/component/host-summary-card/data.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
export const data = [
|
||||
{
|
||||
'name': 'Up',
|
||||
'value': 15
|
||||
},
|
||||
{
|
||||
'name': 'Warning',
|
||||
'value': 40
|
||||
},
|
||||
{
|
||||
'name': 'Down',
|
||||
'value': 2
|
||||
}
|
||||
];
|
|
@ -1,3 +1,9 @@
|
|||
<p>
|
||||
host-summary-card works!
|
||||
</p>
|
||||
<div class="mat-elevation-z4 ">
|
||||
<mat-toolbar>
|
||||
<mat-toolbar-row>
|
||||
<span>Hosts</span>
|
||||
</mat-toolbar-row>
|
||||
</mat-toolbar>
|
||||
<ngx-charts-advanced-pie-chart [view]="view" [scheme]="colorScheme" [results]="data" [gradient]="gradient" (select)="onSelect($event)">
|
||||
</ngx-charts-advanced-pie-chart>
|
||||
</div>
|
|
@ -1,4 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { data } from './data';
|
||||
|
||||
@Component({
|
||||
selector: 'of-host-summary-card',
|
||||
|
@ -7,7 +8,19 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class HostSummaryCardComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
view: any[] = [440, 180];
|
||||
|
||||
colorScheme = {
|
||||
domain: ['#5AA454', '#C7B42C', '#A10A28']
|
||||
};
|
||||
|
||||
constructor() {
|
||||
Object.assign(this, { data });
|
||||
}
|
||||
|
||||
onSelect(event) {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<div class="sales-list mat-elevation-z4 ">
|
||||
<mat-toolbar>
|
||||
|
||||
<mat-toolbar-row>
|
||||
<span>Sensor Items Summary</span>
|
||||
<span class="pull-right"></span>
|
||||
|
@ -32,5 +31,4 @@
|
|||
</mat-chip-list>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
|
||||
</div>
|
|
@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class SensorSummaryComponent implements OnInit {
|
||||
|
||||
public showLoader = false;
|
||||
private showLoader = false;
|
||||
|
||||
// icon 상태별 색깔 아이콘으로 교체
|
||||
public sensorStatusList = [
|
||||
|
|
|
@ -2,14 +2,19 @@
|
|||
|
||||
<div fxFlex="70" fxLayout="column" class="mat-elevation-z2 activity-list-container">
|
||||
|
||||
<div fxLayoutAlign="start center" fxLayout="row">
|
||||
<div fxLayout="row" fxLayoutAlign="space-between center">
|
||||
<of-host-summary-card></of-host-summary-card>
|
||||
<of-app-summary-card></of-app-summary-card>
|
||||
</div>
|
||||
|
||||
<!-- <div fxLayoutAlign="start center" fxLayout="row">
|
||||
<div *ngFor="let dash of dashCard" fxFlex.lt-sm="70">
|
||||
<of-dashboard-card [dashData]="dash"></of-dashboard-card>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div fxLayout="row" fxLayoutWrap>
|
||||
<of-sensor-summary fxFlex="60" fxFlex.lt-sm="100" fxFlex.sm="100" fxFlex.md="70" ></of-sensor-summary>
|
||||
<div fxLayout="row" fxLayoutWrap [style.margin]="'20px 0px'">
|
||||
<of-sensor-summary fxFlex="40" fxFlex.lt-sm="100" fxFlex.sm="100" fxFlex.md="70"></of-sensor-summary>
|
||||
<of-sensor-item-filter></of-sensor-item-filter>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
|||
import { SensorSummaryComponent } from '../../commons/component/sensor-summary/sensor-summary.component';
|
||||
import { SensorItemFilterComponent } from '../../commons/component/sensor-item-filter/sensor-item-filter.component';
|
||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||
import { HostSummaryCardComponent } from '../../commons/component/host-summary-card/host-summary-card.component';
|
||||
import { AppSummaryCardComponent } from '../../commons/component/app-summary-card/app-summary-card.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -24,7 +26,9 @@ import { NgxChartsModule } from '@swimlane/ngx-charts';
|
|||
OverviewPageComponent,
|
||||
AddDashboardDialogComponent,
|
||||
SensorSummaryComponent,
|
||||
SensorItemFilterComponent
|
||||
SensorItemFilterComponent,
|
||||
HostSummaryCardComponent,
|
||||
AppSummaryCardComponent
|
||||
],
|
||||
entryComponents: [
|
||||
AddDashboardDialogComponent
|
||||
|
|
Loading…
Reference in New Issue
Block a user