cats4u-charts 0.0.1
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/.editorconfig +17 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +59 -0
- package/angular.json +118 -0
- package/dist/charts-lib/README.md +63 -0
- package/dist/charts-lib/fesm2022/charts-lib.mjs +3418 -0
- package/dist/charts-lib/fesm2022/charts-lib.mjs.map +1 -0
- package/dist/charts-lib/index.d.ts +110 -0
- package/package.json +58 -0
- package/projects/charts-lib/README.md +63 -0
- package/projects/charts-lib/ng-package.json +8 -0
- package/projects/charts-lib/package.json +12 -0
- package/projects/charts-lib/src/lib/charts-lib.html +1 -0
- package/projects/charts-lib/src/lib/charts-lib.spec.ts +23 -0
- package/projects/charts-lib/src/lib/charts-lib.ts +121 -0
- package/projects/charts-lib/src/lib/component/area-chart/area-chart.html +1 -0
- package/projects/charts-lib/src/lib/component/area-chart/area-chart.scss +0 -0
- package/projects/charts-lib/src/lib/component/area-chart/area-chart.spec.ts +23 -0
- package/projects/charts-lib/src/lib/component/area-chart/area-chart.ts +266 -0
- package/projects/charts-lib/src/lib/component/bar-chart/bar-chart.html +1 -0
- package/projects/charts-lib/src/lib/component/bar-chart/bar-chart.scss +0 -0
- package/projects/charts-lib/src/lib/component/bar-chart/bar-chart.spec.ts +23 -0
- package/projects/charts-lib/src/lib/component/bar-chart/bar-chart.ts +301 -0
- package/projects/charts-lib/src/lib/component/line-chart/line-chart.html +1 -0
- package/projects/charts-lib/src/lib/component/line-chart/line-chart.scss +0 -0
- package/projects/charts-lib/src/lib/component/line-chart/line-chart.spec.ts +23 -0
- package/projects/charts-lib/src/lib/component/line-chart/line-chart.ts +266 -0
- package/projects/charts-lib/src/lib/modal/charts-lib.modal.ts +79 -0
- package/projects/charts-lib/src/lib/services/chart.service.ts +296 -0
- package/projects/charts-lib/src/lib/themes/chalk.ts +357 -0
- package/projects/charts-lib/src/lib/themes/dark.ts +380 -0
- package/projects/charts-lib/src/lib/themes/default.ts +377 -0
- package/projects/charts-lib/src/lib/themes/essos.ts +357 -0
- package/projects/charts-lib/src/lib/themes/roma.ts +399 -0
- package/projects/charts-lib/src/lib/themes/vintage.ts +378 -0
- package/projects/charts-lib/src/public-api.ts +2 -0
- package/projects/charts-lib/tsconfig.lib.json +14 -0
- package/projects/charts-lib/tsconfig.lib.prod.json +11 -0
- package/projects/charts-lib/tsconfig.spec.json +15 -0
- package/projects/demo-app/public/favicon.ico +0 -0
- package/projects/demo-app/src/app/app.config.ts +16 -0
- package/projects/demo-app/src/app/app.html +43 -0
- package/projects/demo-app/src/app/app.routes.ts +3 -0
- package/projects/demo-app/src/app/app.scss +47 -0
- package/projects/demo-app/src/app/app.spec.ts +25 -0
- package/projects/demo-app/src/app/app.ts +98 -0
- package/projects/demo-app/src/index.html +13 -0
- package/projects/demo-app/src/main.ts +6 -0
- package/projects/demo-app/src/styles.scss +4 -0
- package/projects/demo-app/tsconfig.app.json +15 -0
- package/projects/demo-app/tsconfig.spec.json +15 -0
- package/tsconfig.json +43 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import * as echarts from 'echarts';
|
|
2
|
+
const vintageTheme = {
|
|
3
|
+
color: [
|
|
4
|
+
'#d87c7c',
|
|
5
|
+
'#919e8b',
|
|
6
|
+
'#d7ab82',
|
|
7
|
+
'#6e7074',
|
|
8
|
+
'#61a0a8',
|
|
9
|
+
'#efa18d',
|
|
10
|
+
'#787464',
|
|
11
|
+
'#cc7e63',
|
|
12
|
+
'#724e58',
|
|
13
|
+
'#4b565b',
|
|
14
|
+
],
|
|
15
|
+
backgroundColor: 'rgba(254,248,239,1)',
|
|
16
|
+
textStyle: {},
|
|
17
|
+
title: {
|
|
18
|
+
textStyle: {
|
|
19
|
+
color: '#333333',
|
|
20
|
+
},
|
|
21
|
+
subtextStyle: {
|
|
22
|
+
color: '#aaa',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
line: {
|
|
26
|
+
itemStyle: {
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
},
|
|
29
|
+
lineStyle: {
|
|
30
|
+
width: 2,
|
|
31
|
+
},
|
|
32
|
+
symbolSize: 4,
|
|
33
|
+
symbol: 'emptyCircle',
|
|
34
|
+
smooth: false,
|
|
35
|
+
},
|
|
36
|
+
radar: {
|
|
37
|
+
itemStyle: {
|
|
38
|
+
borderWidth: 1,
|
|
39
|
+
},
|
|
40
|
+
lineStyle: {
|
|
41
|
+
width: 2,
|
|
42
|
+
},
|
|
43
|
+
symbolSize: 4,
|
|
44
|
+
symbol: 'emptyCircle',
|
|
45
|
+
smooth: false,
|
|
46
|
+
},
|
|
47
|
+
bar: {
|
|
48
|
+
itemStyle: {
|
|
49
|
+
barBorderWidth: 0,
|
|
50
|
+
barBorderColor: '#ccc',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
pie: {
|
|
54
|
+
itemStyle: {
|
|
55
|
+
borderWidth: 0,
|
|
56
|
+
borderColor: '#ccc',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
scatter: {
|
|
60
|
+
itemStyle: {
|
|
61
|
+
borderWidth: 0,
|
|
62
|
+
borderColor: '#ccc',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
boxplot: {
|
|
66
|
+
itemStyle: {
|
|
67
|
+
borderWidth: 0,
|
|
68
|
+
borderColor: '#ccc',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
parallel: {
|
|
72
|
+
itemStyle: {
|
|
73
|
+
borderWidth: 0,
|
|
74
|
+
borderColor: '#ccc',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
sankey: {
|
|
78
|
+
itemStyle: {
|
|
79
|
+
borderWidth: 0,
|
|
80
|
+
borderColor: '#ccc',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
funnel: {
|
|
84
|
+
itemStyle: {
|
|
85
|
+
borderWidth: 0,
|
|
86
|
+
borderColor: '#ccc',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
gauge: {
|
|
90
|
+
itemStyle: {
|
|
91
|
+
borderWidth: 0,
|
|
92
|
+
borderColor: '#ccc',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
candlestick: {
|
|
96
|
+
itemStyle: {
|
|
97
|
+
color: '#c23531',
|
|
98
|
+
color0: '#314656',
|
|
99
|
+
borderColor: '#c23531',
|
|
100
|
+
borderColor0: '#314656',
|
|
101
|
+
borderWidth: 1,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
graph: {
|
|
105
|
+
itemStyle: {
|
|
106
|
+
borderWidth: 0,
|
|
107
|
+
borderColor: '#ccc',
|
|
108
|
+
},
|
|
109
|
+
lineStyle: {
|
|
110
|
+
width: 1,
|
|
111
|
+
color: '#aaa',
|
|
112
|
+
},
|
|
113
|
+
symbolSize: 4,
|
|
114
|
+
symbol: 'emptyCircle',
|
|
115
|
+
smooth: false,
|
|
116
|
+
color: [
|
|
117
|
+
'#d87c7c',
|
|
118
|
+
'#919e8b',
|
|
119
|
+
'#d7ab82',
|
|
120
|
+
'#6e7074',
|
|
121
|
+
'#61a0a8',
|
|
122
|
+
'#efa18d',
|
|
123
|
+
'#787464',
|
|
124
|
+
'#cc7e63',
|
|
125
|
+
'#724e58',
|
|
126
|
+
'#4b565b',
|
|
127
|
+
],
|
|
128
|
+
label: {
|
|
129
|
+
color: '#eee',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
map: {
|
|
133
|
+
itemStyle: {
|
|
134
|
+
areaColor: '#eeeeee',
|
|
135
|
+
borderColor: '#444444',
|
|
136
|
+
borderWidth: 0.5,
|
|
137
|
+
},
|
|
138
|
+
label: {
|
|
139
|
+
color: '#000000',
|
|
140
|
+
},
|
|
141
|
+
emphasis: {
|
|
142
|
+
itemStyle: {
|
|
143
|
+
areaColor: 'rgba(255,215,0,0.8)',
|
|
144
|
+
borderColor: '#444444',
|
|
145
|
+
borderWidth: 1,
|
|
146
|
+
},
|
|
147
|
+
label: {
|
|
148
|
+
color: 'rgb(100,0,0)',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
geo: {
|
|
153
|
+
itemStyle: {
|
|
154
|
+
areaColor: '#eeeeee',
|
|
155
|
+
borderColor: '#444444',
|
|
156
|
+
borderWidth: 0.5,
|
|
157
|
+
},
|
|
158
|
+
label: {
|
|
159
|
+
color: '#000000',
|
|
160
|
+
},
|
|
161
|
+
emphasis: {
|
|
162
|
+
itemStyle: {
|
|
163
|
+
areaColor: 'rgba(255,215,0,0.8)',
|
|
164
|
+
borderColor: '#444444',
|
|
165
|
+
borderWidth: 1,
|
|
166
|
+
},
|
|
167
|
+
label: {
|
|
168
|
+
color: 'rgb(100,0,0)',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
categoryAxis: {
|
|
173
|
+
axisLine: {
|
|
174
|
+
show: true,
|
|
175
|
+
lineStyle: {
|
|
176
|
+
color: '#333',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
axisTick: {
|
|
180
|
+
show: true,
|
|
181
|
+
lineStyle: {
|
|
182
|
+
color: '#333',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
axisLabel: {
|
|
186
|
+
show: true,
|
|
187
|
+
color: '#333',
|
|
188
|
+
},
|
|
189
|
+
splitLine: {
|
|
190
|
+
show: false,
|
|
191
|
+
lineStyle: {
|
|
192
|
+
color: ['#ccc'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
splitArea: {
|
|
196
|
+
show: false,
|
|
197
|
+
areaStyle: {
|
|
198
|
+
color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
valueAxis: {
|
|
203
|
+
axisLine: {
|
|
204
|
+
show: true,
|
|
205
|
+
lineStyle: {
|
|
206
|
+
color: '#333',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
axisTick: {
|
|
210
|
+
show: true,
|
|
211
|
+
lineStyle: {
|
|
212
|
+
color: '#333',
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
axisLabel: {
|
|
216
|
+
show: true,
|
|
217
|
+
color: '#333',
|
|
218
|
+
},
|
|
219
|
+
splitLine: {
|
|
220
|
+
show: true,
|
|
221
|
+
lineStyle: {
|
|
222
|
+
color: ['#ccc'],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
splitArea: {
|
|
226
|
+
show: false,
|
|
227
|
+
areaStyle: {
|
|
228
|
+
color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
logAxis: {
|
|
233
|
+
axisLine: {
|
|
234
|
+
show: true,
|
|
235
|
+
lineStyle: {
|
|
236
|
+
color: '#333',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
axisTick: {
|
|
240
|
+
show: true,
|
|
241
|
+
lineStyle: {
|
|
242
|
+
color: '#333',
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
axisLabel: {
|
|
246
|
+
show: true,
|
|
247
|
+
color: '#333',
|
|
248
|
+
},
|
|
249
|
+
splitLine: {
|
|
250
|
+
show: true,
|
|
251
|
+
lineStyle: {
|
|
252
|
+
color: ['#ccc'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
splitArea: {
|
|
256
|
+
show: false,
|
|
257
|
+
areaStyle: {
|
|
258
|
+
color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
timeAxis: {
|
|
263
|
+
axisLine: {
|
|
264
|
+
show: true,
|
|
265
|
+
lineStyle: {
|
|
266
|
+
color: '#333',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
axisTick: {
|
|
270
|
+
show: true,
|
|
271
|
+
lineStyle: {
|
|
272
|
+
color: '#333',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
axisLabel: {
|
|
276
|
+
show: true,
|
|
277
|
+
color: '#333',
|
|
278
|
+
},
|
|
279
|
+
splitLine: {
|
|
280
|
+
show: true,
|
|
281
|
+
lineStyle: {
|
|
282
|
+
color: ['#ccc'],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
splitArea: {
|
|
286
|
+
show: false,
|
|
287
|
+
areaStyle: {
|
|
288
|
+
color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
toolbox: {
|
|
293
|
+
iconStyle: {
|
|
294
|
+
borderColor: '#999999',
|
|
295
|
+
},
|
|
296
|
+
emphasis: {
|
|
297
|
+
iconStyle: {
|
|
298
|
+
borderColor: '#666666',
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
legend: {
|
|
303
|
+
textStyle: {
|
|
304
|
+
color: '#333333',
|
|
305
|
+
},
|
|
306
|
+
left: 'center',
|
|
307
|
+
right: 'auto',
|
|
308
|
+
top: 0,
|
|
309
|
+
bottom: 10,
|
|
310
|
+
},
|
|
311
|
+
tooltip: {
|
|
312
|
+
axisPointer: {
|
|
313
|
+
lineStyle: {
|
|
314
|
+
color: '#cccccc',
|
|
315
|
+
width: 1,
|
|
316
|
+
},
|
|
317
|
+
crossStyle: {
|
|
318
|
+
color: '#cccccc',
|
|
319
|
+
width: 1,
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
timeline: {
|
|
324
|
+
lineStyle: {
|
|
325
|
+
color: '#293c55',
|
|
326
|
+
width: 1,
|
|
327
|
+
},
|
|
328
|
+
itemStyle: {
|
|
329
|
+
color: '#293c55',
|
|
330
|
+
borderWidth: 1,
|
|
331
|
+
},
|
|
332
|
+
controlStyle: {
|
|
333
|
+
color: '#293c55',
|
|
334
|
+
borderColor: '#293c55',
|
|
335
|
+
borderWidth: 0.5,
|
|
336
|
+
},
|
|
337
|
+
checkpointStyle: {
|
|
338
|
+
color: '#e43c59',
|
|
339
|
+
borderColor: 'rgba(194,53,49,0.5)',
|
|
340
|
+
},
|
|
341
|
+
label: {
|
|
342
|
+
color: '#293c55',
|
|
343
|
+
},
|
|
344
|
+
emphasis: {
|
|
345
|
+
itemStyle: {
|
|
346
|
+
color: '#a9334c',
|
|
347
|
+
},
|
|
348
|
+
controlStyle: {
|
|
349
|
+
color: '#293c55',
|
|
350
|
+
borderColor: '#293c55',
|
|
351
|
+
borderWidth: 0.5,
|
|
352
|
+
},
|
|
353
|
+
label: {
|
|
354
|
+
color: '#293c55',
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
visualMap: {
|
|
359
|
+
color: ['#bf444c', '#d88273', '#f6efa6'],
|
|
360
|
+
},
|
|
361
|
+
markPoint: {
|
|
362
|
+
label: {
|
|
363
|
+
color: '#eee',
|
|
364
|
+
},
|
|
365
|
+
emphasis: {
|
|
366
|
+
label: {
|
|
367
|
+
color: '#eee',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
grid: {
|
|
372
|
+
left: '10%',
|
|
373
|
+
right: '10%',
|
|
374
|
+
top: 60,
|
|
375
|
+
bottom: 70,
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
echarts.registerTheme('vintage', (vintageTheme as any).default ?? vintageTheme);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts"],
|
|
13
|
+
"exclude": ["**/*.spec.ts"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.d.ts",
|
|
13
|
+
"src/**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ApplicationConfig,
|
|
3
|
+
provideBrowserGlobalErrorListeners,
|
|
4
|
+
provideZonelessChangeDetection,
|
|
5
|
+
} from '@angular/core';
|
|
6
|
+
import { provideRouter } from '@angular/router';
|
|
7
|
+
|
|
8
|
+
import { routes } from './app.routes';
|
|
9
|
+
|
|
10
|
+
export const appConfig: ApplicationConfig = {
|
|
11
|
+
providers: [
|
|
12
|
+
provideBrowserGlobalErrorListeners(),
|
|
13
|
+
provideZonelessChangeDetection(),
|
|
14
|
+
provideRouter(routes),
|
|
15
|
+
],
|
|
16
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<div class="header-container">
|
|
2
|
+
<h4>Chart Type:</h4>
|
|
3
|
+
<div class="chartTypesButtonContainer">
|
|
4
|
+
<select name="chartType" id="chartType" [(ngModel)]="chartType">
|
|
5
|
+
@for (type of chartTypeList; track $index) {
|
|
6
|
+
<option [value]="type">{{ type }}</option>
|
|
7
|
+
}
|
|
8
|
+
</select>
|
|
9
|
+
</div>
|
|
10
|
+
<h4>Theme:</h4>
|
|
11
|
+
<div>
|
|
12
|
+
<select [(ngModel)]="themeName">
|
|
13
|
+
@for (theme of themeList; track $index) {
|
|
14
|
+
<option [value]="theme">{{ theme }}</option>
|
|
15
|
+
}
|
|
16
|
+
</select>
|
|
17
|
+
</div>
|
|
18
|
+
<h4>Custom colors set:</h4>
|
|
19
|
+
<div>
|
|
20
|
+
<select (change)="onColorsChange($event)" name="themeColors" id="themeColors">
|
|
21
|
+
@for (item of colorsData; track $index) {
|
|
22
|
+
<option [value]="item.id">
|
|
23
|
+
{{ item.label }}
|
|
24
|
+
</option>
|
|
25
|
+
}
|
|
26
|
+
</select>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="body-container">
|
|
30
|
+
<div style="width: 1000px; height: 600px">
|
|
31
|
+
<lib-charts-lib
|
|
32
|
+
[chartType]="chartType"
|
|
33
|
+
[themeName]="themeName"
|
|
34
|
+
[columns]="columns"
|
|
35
|
+
[data]="data"
|
|
36
|
+
[chartOptionsConfig]="chartOptionsConfig"
|
|
37
|
+
(handleSingleClick)="handleDrillDown($event)"
|
|
38
|
+
(handleDrillBy)="handleDrillBy($event)"
|
|
39
|
+
></lib-charts-lib>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<router-outlet />
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.header-container {
|
|
2
|
+
height: 4rem;
|
|
3
|
+
box-shadow: 2px 0 4px #c4c4c4;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
padding: 0 1rem;
|
|
8
|
+
.chartTypesButtonContainer {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 1rem;
|
|
12
|
+
}
|
|
13
|
+
button {
|
|
14
|
+
padding: 0.5rem 1rem;
|
|
15
|
+
border-radius: 1rem;
|
|
16
|
+
outline: none;
|
|
17
|
+
border: 1px solid rgb(147, 70, 255);
|
|
18
|
+
background-color: rgb(191, 148, 252);
|
|
19
|
+
box-shadow: 1px 1px 4px rgb(185, 135, 255);
|
|
20
|
+
&:hover {
|
|
21
|
+
background-color: rgb(183, 132, 255);
|
|
22
|
+
}
|
|
23
|
+
&:active {
|
|
24
|
+
background-color: rgb(173, 114, 255);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
select {
|
|
28
|
+
padding: 0.5rem;
|
|
29
|
+
border: 1px solid #565656;
|
|
30
|
+
border-radius: 0.5rem;
|
|
31
|
+
width: 10rem;
|
|
32
|
+
outline: none;
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
font-size: 1rem;
|
|
35
|
+
&:active {
|
|
36
|
+
border: 1px solid rgb(147, 70, 255);
|
|
37
|
+
box-shadow: 0 0 4px rgb(185, 135, 255);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.body-container {
|
|
42
|
+
width: 100vw;
|
|
43
|
+
height: calc(100vh - 4rem);
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { provideZonelessChangeDetection } from '@angular/core';
|
|
2
|
+
import { TestBed } from '@angular/core/testing';
|
|
3
|
+
import { App } from './app';
|
|
4
|
+
|
|
5
|
+
describe('App', () => {
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
await TestBed.configureTestingModule({
|
|
8
|
+
imports: [App],
|
|
9
|
+
providers: [provideZonelessChangeDetection()]
|
|
10
|
+
}).compileComponents();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should create the app', () => {
|
|
14
|
+
const fixture = TestBed.createComponent(App);
|
|
15
|
+
const app = fixture.componentInstance;
|
|
16
|
+
expect(app).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should render title', () => {
|
|
20
|
+
const fixture = TestBed.createComponent(App);
|
|
21
|
+
fixture.detectChanges();
|
|
22
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
23
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, demo-app');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { RouterOutlet } from '@angular/router';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
OptionsConfig,
|
|
7
|
+
ChartsLib,
|
|
8
|
+
type ChartsLibType,
|
|
9
|
+
ContextMenuListItem,
|
|
10
|
+
ClickEvent,
|
|
11
|
+
} from 'charts-lib';
|
|
12
|
+
import type { ECElementEvent } from 'echarts';
|
|
13
|
+
import type { ZRColor } from 'echarts/types/dist/shared';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'app-root',
|
|
17
|
+
imports: [RouterOutlet, ChartsLib, FormsModule],
|
|
18
|
+
templateUrl: './app.html',
|
|
19
|
+
styleUrl: './app.scss',
|
|
20
|
+
})
|
|
21
|
+
export class App {
|
|
22
|
+
chartType: ChartsLibType['chartType'] = 'bar';
|
|
23
|
+
themeName: ChartsLibType['themeName'] = 'default';
|
|
24
|
+
columns: string[] = ['Created at', 'CPU Usage', 'Memory Usage', 'Free Memory'];
|
|
25
|
+
contextMenuList: ContextMenuListItem[] = [
|
|
26
|
+
{
|
|
27
|
+
label: 'Drill By',
|
|
28
|
+
options: this.columns.map((column) => ({
|
|
29
|
+
label: column,
|
|
30
|
+
action: (event?: ClickEvent) => {
|
|
31
|
+
console.log(event, 'ccccolumn');
|
|
32
|
+
},
|
|
33
|
+
})),
|
|
34
|
+
action: () => {},
|
|
35
|
+
},
|
|
36
|
+
{ label: 'Drill Down', action: () => {} },
|
|
37
|
+
];
|
|
38
|
+
data: any[][] = [
|
|
39
|
+
['11-08-2025', 100, 46, 98],
|
|
40
|
+
['12-08-2025', 90, 56, 98],
|
|
41
|
+
['13-08-2025', 10, 80, 99],
|
|
42
|
+
];
|
|
43
|
+
chartOptionsConfig: OptionsConfig = {
|
|
44
|
+
dataZoom: [
|
|
45
|
+
{
|
|
46
|
+
type: 'slider',
|
|
47
|
+
start: 0,
|
|
48
|
+
end: 100,
|
|
49
|
+
height: 20,
|
|
50
|
+
top: 10,
|
|
51
|
+
textStyle: { fontSize: 12 },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'inside', // Mouse wheel/pinch zoom
|
|
55
|
+
start: 0,
|
|
56
|
+
end: 10,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
colorsData: { id: number; colors: ZRColor | ZRColor[]; label: string }[] = [
|
|
62
|
+
{
|
|
63
|
+
id: 1,
|
|
64
|
+
colors: [],
|
|
65
|
+
label: 'none',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 2,
|
|
69
|
+
colors: ['#516b91', '#59c4e6', '#edafda', '#93b7e3', '#a5e7f0', '#cbb0e3'],
|
|
70
|
+
label: 'set1',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 3,
|
|
74
|
+
colors: ['#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
|
|
75
|
+
label: 'set2',
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
chartTypeList = ['bar', 'line', 'area'];
|
|
79
|
+
themeList = ['default', 'vintage', 'dark', 'essos', 'chalk', 'roma'];
|
|
80
|
+
|
|
81
|
+
handleDrillDown(event: ECElementEvent) {
|
|
82
|
+
console.log(event, 'demo app event');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
onColorsChange(event: Event) {
|
|
86
|
+
const target = event.target as HTMLSelectElement;
|
|
87
|
+
if (target.value != '1') {
|
|
88
|
+
const color = this.colorsData.find((color) => color.id == Number(target.value));
|
|
89
|
+
this.chartOptionsConfig['color'] = color?.colors;
|
|
90
|
+
} else {
|
|
91
|
+
delete this.chartOptionsConfig['color'];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
handleDrillBy(config: ClickEvent): void {
|
|
96
|
+
console.log(config, 'drill by ');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>DemoApp</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-root></app-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/app",
|
|
7
|
+
"types": []
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"src/**/*.ts"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"src/**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|