summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/components/charts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/components/charts')
-rw-r--r--usecaseui-portal/src/app/components/charts/bar/bar.component.ts28
-rw-r--r--usecaseui-portal/src/app/components/charts/line/line.component.ts5
-rw-r--r--usecaseui-portal/src/app/components/charts/pie/pie.component.ts9
3 files changed, 21 insertions, 21 deletions
diff --git a/usecaseui-portal/src/app/components/charts/bar/bar.component.ts b/usecaseui-portal/src/app/components/charts/bar/bar.component.ts
index a7947f4e..38a2fc0d 100644
--- a/usecaseui-portal/src/app/components/charts/bar/bar.component.ts
+++ b/usecaseui-portal/src/app/components/charts/bar/bar.component.ts
@@ -8,9 +8,9 @@ import { SimpleChanges } from '@angular/core/src/metadata/lifecycle_hooks';
})
export class BarComponent implements OnInit {
- // 图形数据
+ // 鍥惧舰鏁版嵁
@Input() chartData;
- // 初始化数据
+ // 鍒濆鍖栨暟鎹
@Input() initData;
constructor() { }
@@ -18,36 +18,32 @@ export class BarComponent implements OnInit {
ngOnInit() {
this.initOpts = {
renderer: 'canvas',
- height: 40,
- width: 160,
+ height: 200,
+ width: 280,
};
this.barOption = {
+ tooltip: this.initData.option.tooltip,
+ grid: this.initData.option.grid,
xAxis: this.initData.option.xAxis,
- yAxis: {
- type: 'category',
- show: false,
- axisTick: {
- show: false
- }
- },
+ yAxis:this.initData.option.yAxis,
series: this.initData.option.series
}
}
ngOnChanges(changes: SimpleChanges) {
- // 当有实例的时候再执行,相当于第一次不执行下面方法
+ // 褰撴湁瀹炰緥鐨勬椂鍊欏啀鎵ц锛岀浉褰撲簬绗竴娆′笉鎵ц涓嬮潰鏂规硶
if (this.chartIntance) {
this.chartDataChange()
}
}
- // 初始化图形高度
+ // 鍒濆鍖栧浘褰㈤珮搴
initOpts: any;
- // 折线图配置
+ // 鎶樼嚎鍥鹃厤缃
barOption: any;
- // 实例对象
+ // 瀹炰緥瀵硅薄
chartIntance: any;
- // 数据变化
+ // 鏁版嵁鍙樺寲
updateOption: any;
chartDataChange() {
this.updateOption = this.chartData;
diff --git a/usecaseui-portal/src/app/components/charts/line/line.component.ts b/usecaseui-portal/src/app/components/charts/line/line.component.ts
index 6c4279cb..55b757ce 100644
--- a/usecaseui-portal/src/app/components/charts/line/line.component.ts
+++ b/usecaseui-portal/src/app/components/charts/line/line.component.ts
@@ -26,10 +26,10 @@ export class LineComponent implements OnInit {
legend: this.initData.option.legend,
dataZoom: this.initData.option.dataZoom,
grid: {
- left: '1%',
+ left: '0%',
right: '3%',
top: '10%',
- bottom: '10%',
+ bottom: '18%',
containLabel: true
},
xAxis: {
@@ -65,7 +65,6 @@ export class LineComponent implements OnInit {
}
ngOnChanges(changes:SimpleChanges){
-
// 褰撴湁瀹炰緥鐨勬椂鍊欏啀鎵ц锛岀浉褰撲簬绗竴娆′笉鎵ц涓嬮潰鏂规硶
if(this.chartIntance){
this.chartDataChange()
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 69d758e3..9302ddb5 100644
--- a/usecaseui-portal/src/app/components/charts/pie/pie.component.ts
+++ b/usecaseui-portal/src/app/components/charts/pie/pie.component.ts
@@ -28,13 +28,18 @@ export class PieComponent implements OnInit {
name: this.initData.option.series[0].name,
type: 'pie',
radius : this.initData.option.series[0].radius,
- center: ['50%', '45%'],
+ center:this.initData.option.series[0].center,
legendHoverLink: false,
hoverOffset: 3,
avoidLabelOverlap: false,
label: this.initData.option.series[0].label,
data:[
- {value:1, name:'11'}
+ {value:5, name:'11'},
+ {value:8, name:'22'},
+ {value:10, name:'33'},
+ {value:20, name:'44'},
+ {value:60, name:'55'},
+
],
itemStyle: this.initData.option.series[0].itemStyle
}