File
Implements
Metadata
| selector |
app-scene-portrait |
| styleUrls |
./scene-portrait.component.scss |
| templateUrl |
./scene-portrait.component.html |
Constructor
constructor(_service)
|
|
|
Parameters :
| Name |
Optional |
| _service |
No
|
|
|
bubble
|
Type : any
|
Default value : []
|
|
|
|
colorScheme
|
Type : object
|
Default value : {
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
}
|
|
|
|
gradient
|
Default value : false
|
|
|
|
showLegend
|
Default value : false
|
|
|
|
showXAxis
|
Default value : true
|
|
|
|
showXAxisLabel
|
Default value : true
|
|
|
|
showYAxis
|
Default value : true
|
|
|
|
showYAxisLabel
|
Default value : true
|
|
|
|
xAxisLabel
|
Type : string
|
Default value : 'Country'
|
|
|
|
yAxisLabel
|
Type : string
|
Default value : 'Population'
|
|
|
import { Component, OnInit, Inject } from '@angular/core';
@Component({
selector: 'app-scene-portrait',
templateUrl: './scene-portrait.component.html',
styleUrls: ['./scene-portrait.component.scss']
})
export class ScenePortraitComponent implements OnInit {
bubble: any = [];
// options
showXAxis = true;
showYAxis = true;
gradient = false;
showLegend = false;
showXAxisLabel = true;
xAxisLabel = 'Country';
showYAxisLabel = true;
yAxisLabel = 'Population';
colorScheme = {
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
};
constructor(@Inject('AnalysisService') private _service) {}
ngOnInit() {
this._service.scenesData();
this.scenes();
}
scenes() {
this._service.scenes$.subscribe(res => {
if (res.datas) {
}
});
}
}
<div fxLayout="column">
<mat-card>
<mat-card-title>场景概览</mat-card-title>
<mat-card-content>
<ngx-charts-bubble-chart [results]="bubble" [legend]="showLegend" [xAxis]="showXAxis" [yAxis]="showYAxis"
[showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" [xAxisLabel]="xAxisLabel" [yAxisLabel]="yAxisLabel"
[scheme]="colorScheme">
</ngx-charts-bubble-chart>
</mat-card-content>
</mat-card>
</div>
<div fxLayout="column">
<mat-card>
<mat-card-title>场景偏好APP</mat-card-title>
<mat-card-content>
</mat-card-content>
</mat-card>
</div>
<div fxLayout="column">
<mat-card>
<mat-card-title>场景使用分布</mat-card-title>
<mat-card-content>
</mat-card-content>
</mat-card>
</div>
<div fxLayout="column">
<mat-card>
<mat-card-title>场景粘性</mat-card-title>
<mat-card-content>
</mat-card-content>
</mat-card>
</div>
:host {
display: block;
margin: 5px;
}
mat-card {
margin: 5px;
padding: 0;
}
mat-card-title {
padding: 16px 24px;
}
mat-card-content {
min-height: 400px;
}
Legend
Html element with directive