diff options
author | Tao Shen <shentao@chinamobile.com> | 2019-04-04 07:57:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-04 07:57:01 +0000 |
commit | 0a42f3237519f65c103318cff8e19155117ea898 (patch) | |
tree | 0de277235e177a5fcadc6d6ef7f41912c9e7eac1 /usecaseui-portal/src/app/components/charts/pie | |
parent | 97c18e70d0d79dedc07118a2ceef20fc41d7ac48 (diff) | |
parent | e5373722e30a8d33070a8ea9c304836673893d93 (diff) |
Merge "Modify the overall code lincence and comments"
Diffstat (limited to 'usecaseui-portal/src/app/components/charts/pie')
-rw-r--r-- | usecaseui-portal/src/app/components/charts/pie/pie.component.html | 2 | ||||
-rw-r--r-- | usecaseui-portal/src/app/components/charts/pie/pie.component.ts | 33 |
2 files changed, 25 insertions, 10 deletions
diff --git a/usecaseui-portal/src/app/components/charts/pie/pie.component.html b/usecaseui-portal/src/app/components/charts/pie/pie.component.html index 5f1e94ce..d063f22a 100644 --- a/usecaseui-portal/src/app/components/charts/pie/pie.component.html +++ b/usecaseui-portal/src/app/components/charts/pie/pie.component.html @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2018 CMCC, Inc. and others. All rights reserved. + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/usecaseui-portal/src/app/components/charts/pie/pie.component.ts b/usecaseui-portal/src/app/components/charts/pie/pie.component.ts index 9302ddb5..b1549ab2 100644 --- a/usecaseui-portal/src/app/components/charts/pie/pie.component.ts +++ b/usecaseui-portal/src/app/components/charts/pie/pie.component.ts @@ -1,3 +1,18 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ import { Component, OnInit, Input } from '@angular/core'; import { SimpleChanges } from '@angular/core/src/metadata/lifecycle_hooks'; @@ -7,9 +22,9 @@ import { SimpleChanges } from '@angular/core/src/metadata/lifecycle_hooks'; styleUrls: ['./pie.component.less'] }) export class PieComponent implements OnInit { - // 图形数据 + // chart Data @Input() chartData; - // 初始化数据 + // init Data @Input() initData; constructor() { } @@ -49,30 +64,30 @@ export class PieComponent implements OnInit { ngOnChanges(changes:SimpleChanges){ - // 当有实例的时候再执行,相当于第一次不执行下面方法 + // Execute when there is an instance, which is equivalent to not executing the following method for the first time. if(this.chartIntance){ this.chartDataChange() } } - // 初始化图形高度 + // Initialize the height of the graphic initOpts:any; - // alarm饼图 + // Alarm pie chart pieOption:any; - // 实例对象 + // Instance object chartIntance:any; - // 数据变化 + // Data change updateOption:any; chartDataChange(){ this.updateOption = this.chartData; - // 要等到updateOption渲染完再执行 + // Wait until the updateOption is finished and then execute this.chartIntance.on('finished',()=>{ this.chartIntance.dispatchAction({ type:'highlight', seriesIndex: 0, dataIndex:0 }) - // 由于所有视图变化渲染都会执行,更新完注销此事件 + //Since all view changes are rendered, this event is logged out after the update this.chartIntance.off('finished') }) } |