File

src/app/analysis/crowd/permeability/permeability.component.ts

Implements

OnInit

Metadata

selector analysis-crowd-permeability
styleUrls ./permeability.component.scss
templateUrl ./permeability.component.html

Index

Properties
Methods
Inputs

Constructor

constructor()

Inputs

data
Type : any

Methods

ngOnInit
ngOnInit()
Returns : void
onSelect
onSelect(event)
Parameters :
Name Optional
event No
Returns : void

Properties

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, Input } from '@angular/core';

@Component({
  selector: 'analysis-crowd-permeability',
  templateUrl: './permeability.component.html',
  styleUrls: ['./permeability.component.scss']
})
export class PermeabilityComponent implements OnInit {
  @Input()
  data: 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() {}

  ngOnInit() {}

  onSelect(event) {
    console.log(event);
  }
}
<mat-card>
  <mat-card-title>人群应用渗透TOP10</mat-card-title>
  <mat-card-content>
    <ngx-charts-bar-vertical *ngIf="data?.length" [scheme]="colorScheme" [results]="data" [gradient]="gradient" [xAxis]="showXAxis"
      [yAxis]="showYAxis" [legend]="showLegend" [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel"
      (select)="onSelect($event)">
    </ngx-charts-bar-vertical>
  </mat-card-content>
</mat-card>

./permeability.component.scss

mat-card {
  margin: 5px;
  padding: 0;
}

mat-card-title {
  padding: 16px 24px;
}

mat-card-content {
  min-height: 400px;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""