@ebuilding/chart 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/echart/bar/index.d.ts +1 -0
- package/echart/bar/src/default/index.d.ts +34 -0
- package/echart/bar/src/index.module.d.ts +7 -0
- package/echart/bar/src/public_api.d.ts +2 -0
- package/echart/bar2/index.d.ts +1 -0
- package/echart/bar2/src/default/index.d.ts +33 -0
- package/echart/bar2/src/index.module.d.ts +7 -0
- package/echart/bar2/src/public_api.d.ts +2 -0
- package/echart/content/index.d.ts +1 -0
- package/echart/content/src/default/index.d.ts +26 -0
- package/echart/content/src/index.module.d.ts +7 -0
- package/echart/content/src/public_api.d.ts +2 -0
- package/echart/index.d.ts +8 -0
- package/echart/indicator/index.d.ts +1 -0
- package/echart/indicator/src/default/index.d.ts +18 -0
- package/echart/indicator/src/index.module.d.ts +7 -0
- package/echart/indicator/src/public_api.d.ts +2 -0
- package/echart/line/index.d.ts +1 -0
- package/echart/line/src/default/index.d.ts +33 -0
- package/echart/line/src/index.module.d.ts +7 -0
- package/echart/line/src/public_api.d.ts +2 -0
- package/echart/number/index.d.ts +1 -0
- package/echart/number/src/default/index.d.ts +17 -0
- package/echart/number/src/index.module.d.ts +7 -0
- package/echart/number/src/public_api.d.ts +2 -0
- package/echart/pie/index.d.ts +1 -0
- package/echart/pie/src/default/index.d.ts +28 -0
- package/echart/pie/src/index.module.d.ts +7 -0
- package/echart/pie/src/public_api.d.ts +2 -0
- package/echart/radar/index.d.ts +1 -0
- package/echart/radar/src/default/index.d.ts +29 -0
- package/echart/radar/src/index.module.d.ts +7 -0
- package/echart/radar/src/public_api.d.ts +2 -0
- package/echart/sort/index.d.ts +1 -0
- package/echart/sort/src/default/index.d.ts +16 -0
- package/echart/sort/src/index.module.d.ts +7 -0
- package/echart/sort/src/public_api.d.ts +2 -0
- package/fesm2022/chart.echart.mjs +885 -0
- package/fesm2022/chart.echart.mjs.map +1 -0
- package/fesm2022/chart.report.mjs +145 -0
- package/fesm2022/chart.report.mjs.map +1 -0
- package/fesm2022/ebuilding-chart.mjs +8 -0
- package/fesm2022/ebuilding-chart.mjs.map +1 -0
- package/fesm2022/echart.bar.mjs +208 -0
- package/fesm2022/echart.bar.mjs.map +1 -0
- package/fesm2022/echart.bar2.mjs +179 -0
- package/fesm2022/echart.bar2.mjs.map +1 -0
- package/fesm2022/echart.content.mjs +100 -0
- package/fesm2022/echart.content.mjs.map +1 -0
- package/fesm2022/echart.indicator.mjs +70 -0
- package/fesm2022/echart.indicator.mjs.map +1 -0
- package/fesm2022/echart.line.mjs +165 -0
- package/fesm2022/echart.line.mjs.map +1 -0
- package/fesm2022/echart.number.mjs +58 -0
- package/fesm2022/echart.number.mjs.map +1 -0
- package/fesm2022/echart.pie.mjs +133 -0
- package/fesm2022/echart.pie.mjs.map +1 -0
- package/fesm2022/echart.radar.mjs +119 -0
- package/fesm2022/echart.radar.mjs.map +1 -0
- package/fesm2022/echart.sort.mjs +51 -0
- package/fesm2022/echart.sort.mjs.map +1 -0
- package/fesm2022/srv.base.mjs +151 -0
- package/fesm2022/srv.base.mjs.map +1 -0
- package/index.d.ts +3 -0
- package/package.json +68 -0
- package/report/index.d.ts +1 -0
- package/report/src/default/index.d.ts +21 -0
- package/report/src/index.module.d.ts +7 -0
- package/report/src/public_api.d.ts +2 -0
- package/service/index.d.ts +53 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import * as echarts from 'echarts/core';
|
|
5
|
+
import { BarChart } from 'echarts/charts';
|
|
6
|
+
import { TitleComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components';
|
|
7
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
8
|
+
import { GramBaseChartService } from '@ebuilding/chart/service';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 条形图
|
|
13
|
+
*/
|
|
14
|
+
echarts.use([BarChart, TitleComponent, TooltipComponent, GridComponent, LegendComponent, CanvasRenderer]);
|
|
15
|
+
class EchartBar2MainComponent extends GramBaseChartService {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() { }
|
|
20
|
+
/**
|
|
21
|
+
* 初始化数据
|
|
22
|
+
*/
|
|
23
|
+
initChartData() {
|
|
24
|
+
if (this.config && this.config.data && this.config.data.val && Array.isArray(this.config.data.val)) {
|
|
25
|
+
let isSingle = this.config.data.val.length == 1;
|
|
26
|
+
this.chartData = this.config.data.val.map((item, index) => {
|
|
27
|
+
let obj = {
|
|
28
|
+
type: 'bar',
|
|
29
|
+
name: item.text,
|
|
30
|
+
data: item.data,
|
|
31
|
+
barMaxWidth: 35,
|
|
32
|
+
itemStyle: isSingle == true
|
|
33
|
+
? {
|
|
34
|
+
normal: {
|
|
35
|
+
borderRadius: [0, 12, 12, 0],
|
|
36
|
+
color: (a) => {
|
|
37
|
+
return this.color[a.dataIndex];
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
: {
|
|
42
|
+
normal: {
|
|
43
|
+
borderRadius: [0, 12, 12, 0],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return obj;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 初始化X轴
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
initChartAxis() {
|
|
56
|
+
if (this.config &&
|
|
57
|
+
this.config.data &&
|
|
58
|
+
this.config.data.x &&
|
|
59
|
+
this.config.data.x.data &&
|
|
60
|
+
Array.isArray(this.config.data.x.data)) {
|
|
61
|
+
return _.cloneDeep(this.config.data.x.data);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 初始化图表配置
|
|
66
|
+
*/
|
|
67
|
+
initChartOption() {
|
|
68
|
+
this.chartOption = {
|
|
69
|
+
color: this.color,
|
|
70
|
+
grid: {
|
|
71
|
+
left: '3%',
|
|
72
|
+
right: '18',
|
|
73
|
+
y2: '50',
|
|
74
|
+
containLabel: true,
|
|
75
|
+
},
|
|
76
|
+
legend: this.chartLegend,
|
|
77
|
+
tooltip: {},
|
|
78
|
+
yAxis: {
|
|
79
|
+
type: 'category',
|
|
80
|
+
data: this.initChartAxis(),
|
|
81
|
+
splitLine: {
|
|
82
|
+
show: true,
|
|
83
|
+
lineStyle: {
|
|
84
|
+
type: 'dashed',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
axisPointer: {
|
|
88
|
+
type: 'shadow',
|
|
89
|
+
},
|
|
90
|
+
axisLine: {
|
|
91
|
+
lineStyle: {
|
|
92
|
+
color: '#dbdbdb',
|
|
93
|
+
width: '1',
|
|
94
|
+
type: 'dotted',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
axisLabel: {
|
|
98
|
+
textStyle: {
|
|
99
|
+
color: '#4d4d4d',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
nameTextStyle: {
|
|
103
|
+
color: '#4d4d4d',
|
|
104
|
+
},
|
|
105
|
+
axisTick: {
|
|
106
|
+
lineStyle: {
|
|
107
|
+
show: true,
|
|
108
|
+
color: '#dbdbdb',
|
|
109
|
+
type: 'dotted',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
xAxis: {
|
|
114
|
+
type: 'value',
|
|
115
|
+
splitLine: {
|
|
116
|
+
show: true,
|
|
117
|
+
lineStyle: {
|
|
118
|
+
type: 'dashed',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
series: this.chartData,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 初始化图表数据
|
|
127
|
+
*/
|
|
128
|
+
loadChartInfo() {
|
|
129
|
+
if (this.config) {
|
|
130
|
+
this.initChartData();
|
|
131
|
+
this.initChartLegend();
|
|
132
|
+
this.initChartOption();
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
this.renderChart();
|
|
135
|
+
}, 0);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 渲染图表
|
|
140
|
+
*/
|
|
141
|
+
renderChart() {
|
|
142
|
+
if (!this.chartInstance) {
|
|
143
|
+
this.chartInstance = echarts.init(this.chartContainer.nativeElement);
|
|
144
|
+
this.chartInstance.setOption(this.chartOption);
|
|
145
|
+
window.addEventListener('resize', () => {
|
|
146
|
+
this.chartInstance?.resize();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2MainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
151
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EchartBar2MainComponent, isStandalone: true, selector: "echart-bar2", usesInheritance: true, ngImport: i0, template: "<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
152
|
+
}
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2MainComponent, decorators: [{
|
|
154
|
+
type: Component,
|
|
155
|
+
args: [{ selector: 'echart-bar2', imports: [
|
|
156
|
+
CommonModule
|
|
157
|
+
], template: "<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}\n"] }]
|
|
158
|
+
}], ctorParameters: () => [] });
|
|
159
|
+
|
|
160
|
+
const components = [EchartBar2MainComponent];
|
|
161
|
+
class EchartBar2Module {
|
|
162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
163
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2Module, imports: [EchartBar2MainComponent], exports: [EchartBar2MainComponent] });
|
|
164
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2Module, imports: [components] });
|
|
165
|
+
}
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartBar2Module, decorators: [{
|
|
167
|
+
type: NgModule,
|
|
168
|
+
args: [{
|
|
169
|
+
imports: [...components],
|
|
170
|
+
exports: [...components],
|
|
171
|
+
}]
|
|
172
|
+
}] });
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Generated bundle index. Do not edit.
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
export { EchartBar2MainComponent, EchartBar2Module };
|
|
179
|
+
//# sourceMappingURL=echart.bar2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echart.bar2.mjs","sources":["../../../../packages/chart/echart/bar2/src/default/index.ts","../../../../packages/chart/echart/bar2/src/default/index.html","../../../../packages/chart/echart/bar2/src/index.module.ts","../../../../packages/chart/echart/bar2/echart.bar2.ts"],"sourcesContent":["/**\n * 条形图\n */\nimport { Component, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport * as echarts from 'echarts/core';\nimport { BarChart } from 'echarts/charts';\nimport { TitleComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { GramBaseChartService } from '@ebuilding/chart/service';\nimport _ from 'lodash';\necharts.use([BarChart, TitleComponent, TooltipComponent, GridComponent, LegendComponent, CanvasRenderer]);\n\n@Component({\n selector: 'echart-bar2',\n templateUrl: './index.html',\n styleUrls: ['./index.less'],\n imports: [\n CommonModule\n ]\n})\nexport class EchartBar2MainComponent extends GramBaseChartService implements OnInit {\n constructor() {\n super();\n }\n\n ngOnInit(): void { }\n\n /**\n * 初始化数据\n */\n initChartData() {\n if (this.config!! && this.config.data!! && this.config.data.val!! && Array.isArray(this.config.data.val)) {\n let isSingle: boolean = this.config.data.val.length == 1;\n this.chartData = this.config.data.val.map((item: any, index: number) => {\n let obj: any = {\n type: 'bar',\n name: item.text,\n data: item.data,\n barMaxWidth: 35,\n itemStyle:\n isSingle == true\n ? {\n normal: {\n borderRadius: [0, 12, 12, 0],\n color: (a: any) => {\n return this.color[a.dataIndex];\n },\n },\n }\n : {\n normal: {\n borderRadius: [0, 12, 12, 0],\n },\n },\n };\n return obj;\n });\n }\n }\n\n /**\n * 初始化X轴\n * @returns\n */\n initChartAxis() {\n if (\n this.config!! &&\n this.config.data!! &&\n this.config.data.x!! &&\n this.config.data.x.data!! &&\n Array.isArray(this.config.data.x.data)\n ) {\n return _.cloneDeep(this.config.data.x.data);\n }\n }\n\n /**\n * 初始化图表配置\n */\n initChartOption() {\n this.chartOption = {\n color: this.color,\n grid: {\n left: '3%',\n right: '18',\n y2: '50',\n containLabel: true,\n },\n legend: this.chartLegend,\n tooltip: {},\n yAxis: {\n type: 'category',\n data: this.initChartAxis(),\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n },\n },\n axisPointer: {\n type: 'shadow',\n },\n axisLine: {\n lineStyle: {\n color: '#dbdbdb',\n width: '1',\n type: 'dotted',\n },\n },\n axisLabel: {\n textStyle: {\n color: '#4d4d4d',\n },\n },\n nameTextStyle: {\n color: '#4d4d4d',\n },\n axisTick: {\n lineStyle: {\n show: true,\n color: '#dbdbdb',\n type: 'dotted',\n },\n },\n },\n xAxis: {\n type: 'value',\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n series: this.chartData,\n };\n }\n\n /**\n * 初始化图表数据\n */\n override loadChartInfo() {\n if (this.config!!) {\n this.initChartData();\n this.initChartLegend();\n this.initChartOption();\n setTimeout(() => {\n this.renderChart();\n }, 0);\n }\n }\n\n /**\n * 渲染图表\n */\n renderChart() {\n if (!this.chartInstance) {\n this.chartInstance = echarts.init(this.chartContainer.nativeElement);\n this.chartInstance.setOption(this.chartOption);\n window.addEventListener('resize', () => {\n this.chartInstance?.resize();\n });\n }\n }\n}\n","<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>","import { NgModule } from '@angular/core';\nimport { EchartBar2MainComponent } from './default/index';\nconst components: any[] = [EchartBar2MainComponent];\n\n@NgModule({\n imports: [...components],\n exports: [...components],\n})\nexport class EchartBar2Module { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;AAEG;AASH,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;AAUnG,MAAO,uBAAwB,SAAQ,oBAAoB,CAAA;AAC/D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAGT,IAAA,QAAQ;AAER;;AAEG;IACH,aAAa,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,MAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AACxG,YAAA,IAAI,QAAQ,GAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC;AACxD,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AA,EAAA,MAAA,EAAA,CAAA,qFAAA,CAAA,EAAA;;;AEjBH,MAAM,UAAU,GAAU,CAAC,uBAAuB,CAAC;MAMtC,gBAAgB,CAAA;wGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAhB,gBAAgB,EAAA,OAAA,EAAA,CANF,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAAvB,uBAAuB,CAAA,EAAA,CAAA;AAMrC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHd,UAAU,CAAA,EAAA,CAAA;;4FAGZ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, ViewContainerRef, ViewChild, Output, Input, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { EchartBarMainComponent } from '@ebuilding/chart/echart/bar';
|
|
4
|
+
import { EchartBar2MainComponent } from '@ebuilding/chart/echart/bar2';
|
|
5
|
+
import { EchartLineMainComponent } from '@ebuilding/chart/echart/line';
|
|
6
|
+
import { EchartPieMainComponent } from '@ebuilding/chart/echart/pie';
|
|
7
|
+
import { EchartRadarMainComponent } from '@ebuilding/chart/echart/radar';
|
|
8
|
+
import { EchartNumberMainComponent } from '@ebuilding/chart/echart/number';
|
|
9
|
+
import { EchartIndicatorMainComponent } from '@ebuilding/chart/echart/indicator';
|
|
10
|
+
import { EchartSortMainComponent } from '@ebuilding/chart/echart/sort';
|
|
11
|
+
|
|
12
|
+
const dynamicComponents = {
|
|
13
|
+
bar: EchartBarMainComponent,
|
|
14
|
+
bar2: EchartBar2MainComponent,
|
|
15
|
+
line: EchartLineMainComponent,
|
|
16
|
+
pie: EchartPieMainComponent,
|
|
17
|
+
radar: EchartRadarMainComponent,
|
|
18
|
+
number: EchartNumberMainComponent,
|
|
19
|
+
indicator: EchartIndicatorMainComponent,
|
|
20
|
+
sort: EchartSortMainComponent
|
|
21
|
+
};
|
|
22
|
+
class EchartContentComponent {
|
|
23
|
+
elementRef;
|
|
24
|
+
componentFactoryResolver;
|
|
25
|
+
config = {};
|
|
26
|
+
editEvent = new EventEmitter();
|
|
27
|
+
detailEvent = new EventEmitter();
|
|
28
|
+
copyEvent = new EventEmitter();
|
|
29
|
+
deleteEvent = new EventEmitter();
|
|
30
|
+
componentHost;
|
|
31
|
+
component;
|
|
32
|
+
constructor(elementRef, componentFactoryResolver) {
|
|
33
|
+
this.elementRef = elementRef;
|
|
34
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
35
|
+
}
|
|
36
|
+
ngOnInit() { }
|
|
37
|
+
ngAfterViewInit() { }
|
|
38
|
+
ngOnDestroy() { }
|
|
39
|
+
ngOnChanges(changes) {
|
|
40
|
+
if (changes['config']) {
|
|
41
|
+
this.renderComponent();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
renderComponent() {
|
|
45
|
+
if (!dynamicComponents[this.config.type]) {
|
|
46
|
+
}
|
|
47
|
+
if (this.componentHost) {
|
|
48
|
+
this.componentHost.clear();
|
|
49
|
+
const compFactory = this.componentFactoryResolver.resolveComponentFactory(dynamicComponents[this.config.type]);
|
|
50
|
+
this.component = this.componentHost.createComponent(compFactory);
|
|
51
|
+
this.component.instance['config'] = this.config;
|
|
52
|
+
this.component.instance.loadChartInfo();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
editChart() { }
|
|
56
|
+
detailChart() { }
|
|
57
|
+
copyChart() { }
|
|
58
|
+
deleteChart() { }
|
|
59
|
+
viewChart() { }
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartContentComponent, deps: [{ token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EchartContentComponent, isStandalone: true, selector: "echart-content", inputs: { config: "config" }, outputs: { editEvent: "editEvent", detailEvent: "detailEvent", copyEvent: "copyEvent", deleteEvent: "deleteEvent" }, viewQueries: [{ propertyName: "componentHost", first: true, predicate: ["componentHost"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container #componentHost></ng-container>", styles: [":host ::ng-deep{display:flex;flex:1;width:100%;height:100%}\n"] });
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartContentComponent, decorators: [{
|
|
64
|
+
type: Component,
|
|
65
|
+
args: [{ selector: 'echart-content', preserveWhitespaces: false, template: "<ng-container #componentHost></ng-container>", styles: [":host ::ng-deep{display:flex;flex:1;width:100%;height:100%}\n"] }]
|
|
66
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }], propDecorators: { config: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}], editEvent: [{
|
|
69
|
+
type: Output
|
|
70
|
+
}], detailEvent: [{
|
|
71
|
+
type: Output
|
|
72
|
+
}], copyEvent: [{
|
|
73
|
+
type: Output
|
|
74
|
+
}], deleteEvent: [{
|
|
75
|
+
type: Output
|
|
76
|
+
}], componentHost: [{
|
|
77
|
+
type: ViewChild,
|
|
78
|
+
args: ['componentHost', { read: ViewContainerRef, static: true }]
|
|
79
|
+
}] } });
|
|
80
|
+
|
|
81
|
+
const components = [EchartContentComponent];
|
|
82
|
+
class EchartContentModule {
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
84
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: EchartContentModule, imports: [EchartContentComponent], exports: [EchartContentComponent] });
|
|
85
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartContentModule });
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartContentModule, decorators: [{
|
|
88
|
+
type: NgModule,
|
|
89
|
+
args: [{
|
|
90
|
+
imports: [...components],
|
|
91
|
+
exports: [...components],
|
|
92
|
+
}]
|
|
93
|
+
}] });
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Generated bundle index. Do not edit.
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
export { EchartContentComponent, EchartContentModule };
|
|
100
|
+
//# sourceMappingURL=echart.content.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echart.content.mjs","sources":["../../../../packages/chart/echart/content/src/default/index.ts","../../../../packages/chart/echart/content/src/default/index.html","../../../../packages/chart/echart/content/src/index.module.ts","../../../../packages/chart/echart/content/echart.content.ts"],"sourcesContent":["import {\n ElementRef,\n Component,\n ComponentRef,\n ComponentFactory,\n OnDestroy,\n OnInit,\n ViewContainerRef,\n Output,\n EventEmitter,\n Input,\n ViewChild,\n ComponentFactoryResolver,\n SimpleChanges,\n} from '@angular/core';\nimport { EchartBarMainComponent } from '@ebuilding/chart/echart/bar';\nimport { EchartBar2MainComponent } from '@ebuilding/chart/echart/bar2';\nimport { EchartLineMainComponent } from '@ebuilding/chart/echart/line';\nimport { EchartPieMainComponent } from '@ebuilding/chart/echart/pie';\nimport { EchartRadarMainComponent } from '@ebuilding/chart/echart/radar';\nimport { EchartNumberMainComponent } from '@ebuilding/chart/echart/number';\nimport { EchartIndicatorMainComponent } from '@ebuilding/chart/echart/indicator';\nimport { EchartSortMainComponent } from '@ebuilding/chart/echart/sort';\n\nconst dynamicComponents: any = {\n bar: EchartBarMainComponent,\n bar2: EchartBar2MainComponent,\n line: EchartLineMainComponent,\n pie: EchartPieMainComponent,\n radar: EchartRadarMainComponent,\n number: EchartNumberMainComponent,\n indicator: EchartIndicatorMainComponent,\n sort: EchartSortMainComponent\n};\n@Component({\n selector: 'echart-content',\n templateUrl: './index.html',\n styleUrls: ['./index.less'],\n preserveWhitespaces: false,\n})\nexport class EchartContentComponent implements OnInit, OnDestroy {\n @Input() config: any = {};\n @Output() editEvent: EventEmitter<any> = new EventEmitter<any>();\n @Output() detailEvent: EventEmitter<any> = new EventEmitter<any>();\n @Output() copyEvent: EventEmitter<any> = new EventEmitter<any>();\n @Output() deleteEvent: EventEmitter<any> = new EventEmitter<any>();\n\n @ViewChild('componentHost', { read: ViewContainerRef, static: true })\n componentHost: ViewContainerRef | undefined;\n\n component: ComponentRef<any> | undefined;\n constructor(public elementRef: ElementRef, public componentFactoryResolver: ComponentFactoryResolver) { }\n\n ngOnInit() { }\n ngAfterViewInit() { }\n ngOnDestroy() { }\n ngOnChanges(changes: SimpleChanges) {\n if (changes['config']) {\n this.renderComponent();\n }\n }\n\n private renderComponent() {\n if (!dynamicComponents[this.config.type]) {\n }\n if (this.componentHost) {\n this.componentHost.clear();\n const compFactory: ComponentFactory<any> = this.componentFactoryResolver.resolveComponentFactory(dynamicComponents[this.config.type]);\n this.component = this.componentHost.createComponent(compFactory);\n this.component.instance['config'] = this.config;\n this.component.instance.loadChartInfo();\n }\n }\n\n editChart() { }\n\n detailChart() { }\n\n copyChart() { }\n\n deleteChart() { }\n\n viewChart() { }\n}\n","<ng-container #componentHost></ng-container>","import { NgModule } from '@angular/core';\nimport { EchartContentComponent } from './default/index';\nconst components: any[] = [EchartContentComponent];\n\n@NgModule({\n imports: [...components],\n exports: [...components],\n})\nexport class EchartContentModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAwBA,MAAM,iBAAiB,GAAQ;AAC7B,IAAA,GAAG,EAAE,sBAAsB;AAC3B,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,GAAG,EAAE,sBAAsB;AAC3B,IAAA,KAAK,EAAE,wBAAwB;AAC/B,IAAA,MAAM,EAAE,yBAAyB;AACjC,IAAA,SAAS,EAAE,4BAA4B;AACvC,IAAA,IAAI,EAAE;CACP;MAOY,sBAAsB,CAAA;AAWd,IAAA,UAAA;AAA+B,IAAA,wBAAA;IAVzC,MAAM,GAAQ,EAAE;AACf,IAAA,SAAS,GAAsB,IAAI,YAAY,EAAO;AACtD,IAAA,WAAW,GAAsB,IAAI,YAAY,EAAO;AACxD,IAAA,SAAS,GAAsB,IAAI,YAAY,EAAO;AACtD,IAAA,WAAW,GAAsB,IAAI,YAAY,EAAO;AAGlE,IAAA,aAAa;AAEb,IAAA,SAAS;IACT,WAAmB,CAAA,UAAsB,EAAS,wBAAkD,EAAA;QAAjF,IAAU,CAAA,UAAA,GAAV,UAAU;QAAqB,IAAwB,CAAA,wBAAA,GAAxB,wBAAwB;;AAE1E,IAAA,QAAQ;AACR,IAAA,eAAe;AACf,IAAA,WAAW;AACX,IAAA,WAAW,CAAC,OAAsB,EAAA;AAChC,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrB,IAAI,CAAC,eAAe,EAAE;;;IAIlB,eAAe,GAAA;QACrB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;;AAE1C,QAAA,IAAI,IAAI,CAAC,aAAa,EAAE;AACtB,YAAA,IAAI,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wC/B,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBANlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,uBAGL,KAAK,EAAA,QAAA,EAAA,8CAAA,EAAA,MAAA,EAAA,CAAA,+DAAA,CAAA,EAAA;sHAGjB,MAAM,EAAA,CAAA;sBAAd;gBACS,SAAS,EAAA,CAAA;sBAAlB;gBACS,WAAW,EAAA,CAAA;sBAApB;gBACS,SAAS,EAAA,CAAA;sBAAlB;gBACS,WAAW,EAAA,CAAA;sBAApB;gBAGD,aAAa,EAAA,CAAA;sBADZ,SAAS;uBAAC,eAAe,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;;AE7CtE,MAAM,UAAU,GAAU,CAAC,sBAAsB,CAAC;MAMrC,mBAAmB,CAAA;wGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAnB,mBAAmB,EAAA,OAAA,EAAA,CANL,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAAtB,sBAAsB,CAAA,EAAA,CAAA;yGAMpC,mBAAmB,EAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { GramBaseChartService } from '@ebuilding/chart/service';
|
|
6
|
+
import _ from 'lodash';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 指标图
|
|
10
|
+
*/
|
|
11
|
+
class EchartIndicatorMainComponent extends GramBaseChartService {
|
|
12
|
+
total = 0;
|
|
13
|
+
list = [];
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 初始化图表数据
|
|
21
|
+
*/
|
|
22
|
+
loadChartInfo() {
|
|
23
|
+
if (this.config) {
|
|
24
|
+
let xData = _.get(this.config, "data.x.data");
|
|
25
|
+
if (xData && Array.isArray(xData) && xData.length > 0) {
|
|
26
|
+
this.list = [];
|
|
27
|
+
let valueData = _.get(this.config, "data.val[0].data");
|
|
28
|
+
if (valueData && Array.isArray(valueData) && valueData.length > 0 && xData.length == valueData.length) {
|
|
29
|
+
xData.forEach((name, index) => {
|
|
30
|
+
let item = {
|
|
31
|
+
name: name,
|
|
32
|
+
value: valueData[index] == null ? 0 : valueData[index]
|
|
33
|
+
};
|
|
34
|
+
this.total = this.total + item.value;
|
|
35
|
+
this.list.push(item);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EchartIndicatorMainComponent, isStandalone: true, selector: "echart-indicator", usesInheritance: true, ngImport: i0, template: "<div class=\"indicator-box\">\n <div class=\"header\">\n <div class=\"name\">\u5171\u8BA1</div>\n <div class=\"value\">{{total}}</div>\n </div>\n <ul class=\"content\">\n <li *ngFor=\"let item of list\">\n <div class=\"name\">{{item.name}}</div>\n <div class=\"value\">{{item.value}}</div>\n </li>\n </ul>\n</div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .indicator-box{display:flex;flex:1;flex-direction:column}:host ::ng-deep .indicator-box .header{display:flex;flex-direction:row;align-items:center;padding:10px 15px;border-bottom:1px solid #f0f0f0}:host ::ng-deep .indicator-box .header .name{flex:1}:host ::ng-deep .indicator-box .header .value{color:#2f7deb;font-weight:600}:host ::ng-deep .indicator-box ul{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}:host ::ng-deep .indicator-box ul li{display:flex;flex-direction:row;align-items:center;padding:7px 12px;border-bottom:1px dotted #f0f0f0}:host ::ng-deep .indicator-box ul li .name{flex:1}:host ::ng-deep .indicator-box ul li .value{padding:2px 10px;color:#2f7deb;background:#eaf2fd;border-radius:6px}:host ::ng-deep .indicator-box ul li:nth-last-child(1){border-bottom:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorMainComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{ selector: 'echart-indicator', imports: [
|
|
47
|
+
CommonModule
|
|
48
|
+
], template: "<div class=\"indicator-box\">\n <div class=\"header\">\n <div class=\"name\">\u5171\u8BA1</div>\n <div class=\"value\">{{total}}</div>\n </div>\n <ul class=\"content\">\n <li *ngFor=\"let item of list\">\n <div class=\"name\">{{item.name}}</div>\n <div class=\"value\">{{item.value}}</div>\n </li>\n </ul>\n</div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .indicator-box{display:flex;flex:1;flex-direction:column}:host ::ng-deep .indicator-box .header{display:flex;flex-direction:row;align-items:center;padding:10px 15px;border-bottom:1px solid #f0f0f0}:host ::ng-deep .indicator-box .header .name{flex:1}:host ::ng-deep .indicator-box .header .value{color:#2f7deb;font-weight:600}:host ::ng-deep .indicator-box ul{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}:host ::ng-deep .indicator-box ul li{display:flex;flex-direction:row;align-items:center;padding:7px 12px;border-bottom:1px dotted #f0f0f0}:host ::ng-deep .indicator-box ul li .name{flex:1}:host ::ng-deep .indicator-box ul li .value{padding:2px 10px;color:#2f7deb;background:#eaf2fd;border-radius:6px}:host ::ng-deep .indicator-box ul li:nth-last-child(1){border-bottom:0}\n"] }]
|
|
49
|
+
}], ctorParameters: () => [] });
|
|
50
|
+
|
|
51
|
+
const components = [EchartIndicatorMainComponent];
|
|
52
|
+
class EchartIndicatorModule {
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
54
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorModule, imports: [EchartIndicatorMainComponent], exports: [EchartIndicatorMainComponent] });
|
|
55
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorModule, imports: [components] });
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartIndicatorModule, decorators: [{
|
|
58
|
+
type: NgModule,
|
|
59
|
+
args: [{
|
|
60
|
+
imports: [...components],
|
|
61
|
+
exports: [...components],
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Generated bundle index. Do not edit.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export { EchartIndicatorMainComponent, EchartIndicatorModule };
|
|
70
|
+
//# sourceMappingURL=echart.indicator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echart.indicator.mjs","sources":["../../../../packages/chart/echart/indicator/src/default/index.ts","../../../../packages/chart/echart/indicator/src/default/index.html","../../../../packages/chart/echart/indicator/src/index.module.ts","../../../../packages/chart/echart/indicator/echart.indicator.ts"],"sourcesContent":["/**\n * 指标图\n */\nimport { Component, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { GramBaseChartService } from '@ebuilding/chart/service';\nimport _ from 'lodash';\n\n@Component({\n selector: 'echart-indicator',\n templateUrl: './index.html',\n styleUrls: ['./index.less'],\n imports: [\n CommonModule\n ]\n})\nexport class EchartIndicatorMainComponent extends GramBaseChartService implements OnInit {\n\n total: number = 0;\n list: any[] = [];\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n }\n\n /**\n * 初始化图表数据\n */\n override loadChartInfo() {\n if (this.config!!) {\n let xData: any[] = _.get(this.config, \"data.x.data\");\n if (xData!! && Array.isArray(xData) && xData.length > 0) {\n this.list = [];\n let valueData: any[] = _.get(this.config, \"data.val[0].data\");\n if (valueData!! && Array.isArray(valueData) && valueData.length > 0 && xData.length == valueData.length) {\n xData.forEach((name: any, index: number) => {\n let item: any = {\n name: name,\n value: valueData[index] == null ? 0 : valueData[index]\n }\n this.total = this.total + item.value;\n this.list.push(item);\n });\n }\n }\n }\n }\n}","<div class=\"indicator-box\">\n <div class=\"header\">\n <div class=\"name\">共计</div>\n <div class=\"value\">{{total}}</div>\n </div>\n <ul class=\"content\">\n <li *ngFor=\"let item of list\">\n <div class=\"name\">{{item.name}}</div>\n <div class=\"value\">{{item.value}}</div>\n </li>\n </ul>\n</div>","import { NgModule } from '@angular/core';\nimport { EchartIndicatorMainComponent } from './default/index';\nconst components: any[] = [EchartIndicatorMainComponent];\n\n@NgModule({\n imports: [...components],\n exports: [...components],\n})\nexport class EchartIndicatorModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG;AAcG,MAAO,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E,CAAC,GAAG,UAAU,CAAC;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import * as echarts from 'echarts/core';
|
|
5
|
+
import { LineChart } from 'echarts/charts';
|
|
6
|
+
import { TitleComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components';
|
|
7
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
8
|
+
import { GramBaseChartService } from '@ebuilding/chart/service';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 线条图
|
|
13
|
+
*/
|
|
14
|
+
echarts.use([LineChart, TitleComponent, TooltipComponent, GridComponent, LegendComponent, CanvasRenderer]);
|
|
15
|
+
class EchartLineMainComponent extends GramBaseChartService {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() { }
|
|
20
|
+
/**
|
|
21
|
+
* 初始化数据
|
|
22
|
+
*/
|
|
23
|
+
initChartData() {
|
|
24
|
+
if (this.config && this.config.data && this.config.data.val && Array.isArray(this.config.data.val)) {
|
|
25
|
+
this.chartData = this.config.data.val.map((item, index) => {
|
|
26
|
+
let obj = {
|
|
27
|
+
type: 'line',
|
|
28
|
+
name: item.text,
|
|
29
|
+
data: item.data,
|
|
30
|
+
smooth: this.config?.izSmooth == true ? true : false,
|
|
31
|
+
areaStyle: this.config?.izArea == true ? {} : null,
|
|
32
|
+
};
|
|
33
|
+
return obj;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 初始化X轴
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
initChartAxis() {
|
|
42
|
+
if (this.config &&
|
|
43
|
+
this.config.data &&
|
|
44
|
+
this.config.data.x &&
|
|
45
|
+
this.config.data.x.data &&
|
|
46
|
+
Array.isArray(this.config.data.x.data)) {
|
|
47
|
+
return _.cloneDeep(this.config.data.x.data);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 初始化图表配置
|
|
52
|
+
*/
|
|
53
|
+
initChartOption() {
|
|
54
|
+
this.chartOption = {
|
|
55
|
+
color: this.color,
|
|
56
|
+
grid: {
|
|
57
|
+
left: '3%',
|
|
58
|
+
right: '18',
|
|
59
|
+
y2: '50',
|
|
60
|
+
containLabel: true,
|
|
61
|
+
},
|
|
62
|
+
legend: this.chartLegend,
|
|
63
|
+
tooltip: {},
|
|
64
|
+
yAxis: {
|
|
65
|
+
splitLine: {
|
|
66
|
+
show: true,
|
|
67
|
+
lineStyle: {
|
|
68
|
+
type: 'dashed',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
xAxis: {
|
|
73
|
+
type: 'category',
|
|
74
|
+
data: this.initChartAxis(),
|
|
75
|
+
axisPointer: {
|
|
76
|
+
type: 'shadow',
|
|
77
|
+
},
|
|
78
|
+
axisLine: {
|
|
79
|
+
lineStyle: {
|
|
80
|
+
color: '#dbdbdb',
|
|
81
|
+
width: '1',
|
|
82
|
+
type: 'dotted',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
splitLine: {
|
|
86
|
+
show: true,
|
|
87
|
+
lineStyle: {
|
|
88
|
+
color: ['#dbdbdb'],
|
|
89
|
+
type: 'dotted',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
axisLabel: {
|
|
93
|
+
textStyle: {
|
|
94
|
+
color: '#4d4d4d',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
nameTextStyle: {
|
|
98
|
+
color: '#4d4d4d',
|
|
99
|
+
},
|
|
100
|
+
axisTick: {
|
|
101
|
+
lineStyle: {
|
|
102
|
+
show: true,
|
|
103
|
+
color: '#dbdbdb',
|
|
104
|
+
type: 'dotted',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
series: this.chartData,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 初始化图表数据
|
|
113
|
+
*/
|
|
114
|
+
loadChartInfo() {
|
|
115
|
+
if (this.config) {
|
|
116
|
+
this.initChartData();
|
|
117
|
+
this.initChartLegend();
|
|
118
|
+
this.initChartOption();
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
this.renderChart();
|
|
121
|
+
}, 0);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 渲染图表
|
|
126
|
+
*/
|
|
127
|
+
renderChart() {
|
|
128
|
+
if (!this.chartInstance) {
|
|
129
|
+
this.chartInstance = echarts.init(this.chartContainer.nativeElement);
|
|
130
|
+
this.chartInstance.setOption(this.chartOption);
|
|
131
|
+
window.addEventListener('resize', () => {
|
|
132
|
+
this.chartInstance?.resize();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartLineMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EchartLineMainComponent, isStandalone: true, selector: "echart-line", usesInheritance: true, ngImport: i0, template: "<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
138
|
+
}
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartLineMainComponent, decorators: [{
|
|
140
|
+
type: Component,
|
|
141
|
+
args: [{ selector: 'echart-line', imports: [
|
|
142
|
+
CommonModule
|
|
143
|
+
], template: "<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}\n"] }]
|
|
144
|
+
}], ctorParameters: () => [] });
|
|
145
|
+
|
|
146
|
+
const components = [EchartLineMainComponent];
|
|
147
|
+
class EchartLineModule {
|
|
148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartLineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
149
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: EchartLineModule, imports: [EchartLineMainComponent], exports: [EchartLineMainComponent] });
|
|
150
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartLineModule, imports: [components] });
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartLineModule, decorators: [{
|
|
153
|
+
type: NgModule,
|
|
154
|
+
args: [{
|
|
155
|
+
imports: [...components],
|
|
156
|
+
exports: [...components],
|
|
157
|
+
}]
|
|
158
|
+
}] });
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generated bundle index. Do not edit.
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
export { EchartLineMainComponent, EchartLineModule };
|
|
165
|
+
//# sourceMappingURL=echart.line.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echart.line.mjs","sources":["../../../../packages/chart/echart/line/src/default/index.ts","../../../../packages/chart/echart/line/src/default/index.html","../../../../packages/chart/echart/line/src/index.module.ts","../../../../packages/chart/echart/line/echart.line.ts"],"sourcesContent":["/**\n * 线条图\n */\nimport { Component, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport * as echarts from 'echarts/core';\nimport { LineChart } from 'echarts/charts';\nimport { TitleComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { GramBaseChartService } from '@ebuilding/chart/service';\nimport _ from 'lodash';\necharts.use([LineChart, TitleComponent, TooltipComponent, GridComponent, LegendComponent, CanvasRenderer]);\n\n@Component({\n selector: 'echart-line',\n templateUrl: './index.html',\n styleUrls: ['./index.less'],\n imports: [\n CommonModule\n ]\n})\nexport class EchartLineMainComponent extends GramBaseChartService implements OnInit {\n constructor() {\n super();\n }\n\n ngOnInit(): void { }\n\n /**\n * 初始化数据\n */\n initChartData() {\n if (this.config!! && this.config.data!! && this.config.data.val!! && Array.isArray(this.config.data.val)) {\n this.chartData = this.config.data.val.map((item: any, index: number) => {\n let obj: any = {\n type: 'line',\n name: item.text,\n data: item.data,\n smooth: this.config?.izSmooth == true ? true : false,\n areaStyle: this.config?.izArea == true ? {} : null,\n };\n return obj;\n });\n }\n }\n\n /**\n * 初始化X轴\n * @returns\n */\n initChartAxis() {\n if (\n this.config!! &&\n this.config.data!! &&\n this.config.data.x!! &&\n this.config.data.x.data!! &&\n Array.isArray(this.config.data.x.data)\n ) {\n return _.cloneDeep(this.config.data.x.data);\n }\n }\n\n /**\n * 初始化图表配置\n */\n initChartOption() {\n this.chartOption = {\n color: this.color,\n grid: {\n left: '3%',\n right: '18',\n y2: '50',\n containLabel: true,\n },\n legend: this.chartLegend,\n tooltip: {},\n yAxis: {\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n },\n },\n },\n xAxis: {\n type: 'category',\n data: this.initChartAxis(),\n axisPointer: {\n type: 'shadow',\n },\n axisLine: {\n lineStyle: {\n color: '#dbdbdb',\n width: '1',\n type: 'dotted',\n },\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#dbdbdb'],\n type: 'dotted',\n },\n },\n axisLabel: {\n textStyle: {\n color: '#4d4d4d',\n },\n },\n nameTextStyle: {\n color: '#4d4d4d',\n },\n axisTick: {\n lineStyle: {\n show: true,\n color: '#dbdbdb',\n type: 'dotted',\n },\n },\n },\n series: this.chartData,\n };\n }\n\n /**\n * 初始化图表数据\n */\n override loadChartInfo() {\n if (this.config!!) {\n this.initChartData();\n this.initChartLegend();\n this.initChartOption();\n setTimeout(() => {\n this.renderChart();\n }, 0);\n }\n }\n\n /**\n * 渲染图表\n */\n renderChart() {\n if (!this.chartInstance) {\n this.chartInstance = echarts.init(this.chartContainer.nativeElement);\n this.chartInstance.setOption(this.chartOption);\n window.addEventListener('resize', () => {\n this.chartInstance?.resize();\n });\n }\n }\n}\n","<div #chartContainer id=\"chartContainer\" style=\"width: 100%; height: 100%;\"></div>","import { NgModule } from '@angular/core';\nimport { EchartLineMainComponent } from './default/index';\nconst components: any[] = [EchartLineMainComponent];\n\n@NgModule({\n imports: [...components],\n exports: [...components],\n})\nexport class EchartLineModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;AAEG;AASH,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;AAUpG,MAAO,uBAAwB,SAAQ,oBAAoB,CAAA;AAC/D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAGT,IAAA,QAAQ;AAER;;AAEG;IACH,aAAa,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,MAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AACxG,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,KAAa,KAAI;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AAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHd,UAAU,CAAA,EAAA,CAAA;;4FAGZ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACzB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { GramBaseChartService } from '@ebuilding/chart/service';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 数字图
|
|
8
|
+
*/
|
|
9
|
+
class EchartNumberMainComponent extends GramBaseChartService {
|
|
10
|
+
text = 0;
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
ngOnInit() {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 初始化图表数据
|
|
18
|
+
*/
|
|
19
|
+
loadChartInfo() {
|
|
20
|
+
if (this.config) {
|
|
21
|
+
if (this.config.val && Array.isArray(this.config.val) && this.config.val.length > 0) {
|
|
22
|
+
let item = this.config.val[0];
|
|
23
|
+
if (item && item.data && Array.isArray(item.data) && item.data.length > 0) {
|
|
24
|
+
this.text = item.data[0];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EchartNumberMainComponent, isStandalone: true, selector: "echart-number", usesInheritance: true, ngImport: i0, template: "{{text}}", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;align-items:center;justify-content:center;color:#323232;font-size:120px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberMainComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ selector: 'echart-number', imports: [
|
|
35
|
+
CommonModule
|
|
36
|
+
], template: "{{text}}", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;align-items:center;justify-content:center;color:#323232;font-size:120px}\n"] }]
|
|
37
|
+
}], ctorParameters: () => [] });
|
|
38
|
+
|
|
39
|
+
const components = [EchartNumberMainComponent];
|
|
40
|
+
class EchartNumberModule {
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
42
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberModule, imports: [EchartNumberMainComponent], exports: [EchartNumberMainComponent] });
|
|
43
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberModule, imports: [components] });
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EchartNumberModule, decorators: [{
|
|
46
|
+
type: NgModule,
|
|
47
|
+
args: [{
|
|
48
|
+
imports: [...components],
|
|
49
|
+
exports: [...components],
|
|
50
|
+
}]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generated bundle index. Do not edit.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export { EchartNumberMainComponent, EchartNumberModule };
|
|
58
|
+
//# sourceMappingURL=echart.number.mjs.map
|