chart apply test
This commit is contained in:
parent
cc662367bd
commit
48d038610e
|
@ -1,3 +1,9 @@
|
||||||
<p>
|
<div class="mat-elevation-z4 ">
|
||||||
app-summary-card works!
|
<mat-toolbar>
|
||||||
</p>
|
<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 { Component, OnInit } from '@angular/core';
|
||||||
|
import { data } from './data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-app-summary-card',
|
selector: 'of-app-summary-card',
|
||||||
|
@ -7,7 +8,19 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class AppSummaryCardComponent implements OnInit {
|
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() {
|
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>
|
<div class="mat-elevation-z4 ">
|
||||||
host-summary-card works!
|
<mat-toolbar>
|
||||||
</p>
|
<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 { Component, OnInit } from '@angular/core';
|
||||||
|
import { data } from './data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-host-summary-card',
|
selector: 'of-host-summary-card',
|
||||||
|
@ -7,7 +8,19 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class HostSummaryCardComponent implements OnInit {
|
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() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<div class="sales-list mat-elevation-z4 ">
|
<div class="sales-list mat-elevation-z4 ">
|
||||||
<mat-toolbar>
|
<mat-toolbar>
|
||||||
|
|
||||||
<mat-toolbar-row>
|
<mat-toolbar-row>
|
||||||
<span>Sensor Items Summary</span>
|
<span>Sensor Items Summary</span>
|
||||||
<span class="pull-right"></span>
|
<span class="pull-right"></span>
|
||||||
|
@ -32,5 +31,4 @@
|
||||||
</mat-chip-list>
|
</mat-chip-list>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
</mat-list>
|
</mat-list>
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class SensorSummaryComponent implements OnInit {
|
export class SensorSummaryComponent implements OnInit {
|
||||||
|
|
||||||
public showLoader = false;
|
private showLoader = false;
|
||||||
|
|
||||||
// icon 상태별 색깔 아이콘으로 교체
|
// icon 상태별 색깔 아이콘으로 교체
|
||||||
public sensorStatusList = [
|
public sensorStatusList = [
|
||||||
|
|
|
@ -2,20 +2,25 @@
|
||||||
|
|
||||||
<div fxFlex="70" fxLayout="column" class="mat-elevation-z2 activity-list-container">
|
<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">
|
<div *ngFor="let dash of dashCard" fxFlex.lt-sm="70">
|
||||||
<of-dashboard-card [dashData]="dash"></of-dashboard-card>
|
<of-dashboard-card [dashData]="dash"></of-dashboard-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div fxLayout="row" fxLayoutWrap>
|
<div fxLayout="row" fxLayoutWrap [style.margin]="'20px 0px'">
|
||||||
<of-sensor-summary fxFlex="60" fxFlex.lt-sm="100" fxFlex.sm="100" fxFlex.md="70" ></of-sensor-summary>
|
<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>
|
<of-sensor-item-filter></of-sensor-item-filter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div fxFlex="30" fxLayout="column" class="mat-elevation-z2 activity-add">
|
<div fxFlex="30" fxLayout="column" class="mat-elevation-z2 activity-add" >
|
||||||
<div fxFlex="10" fxLayout="row" fxLayoutAlign="space-between center">
|
<div fxFlex="10" fxLayout="row" fxLayoutAlign="space-between center">
|
||||||
<h3 class="mat-headline" fxFlex="80">Activities</h3>
|
<h3 class="mat-headline" fxFlex="80">Activities</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,8 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
||||||
import { SensorSummaryComponent } from '../../commons/component/sensor-summary/sensor-summary.component';
|
import { SensorSummaryComponent } from '../../commons/component/sensor-summary/sensor-summary.component';
|
||||||
import { SensorItemFilterComponent } from '../../commons/component/sensor-item-filter/sensor-item-filter.component';
|
import { SensorItemFilterComponent } from '../../commons/component/sensor-item-filter/sensor-item-filter.component';
|
||||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -24,7 +26,9 @@ import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||||
OverviewPageComponent,
|
OverviewPageComponent,
|
||||||
AddDashboardDialogComponent,
|
AddDashboardDialogComponent,
|
||||||
SensorSummaryComponent,
|
SensorSummaryComponent,
|
||||||
SensorItemFilterComponent
|
SensorItemFilterComponent,
|
||||||
|
HostSummaryCardComponent,
|
||||||
|
AppSummaryCardComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
AddDashboardDialogComponent
|
AddDashboardDialogComponent
|
||||||
|
|
Loading…
Reference in New Issue
Block a user