intelica-library-ui 0.1.86 → 0.1.88
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.
|
@@ -158,13 +158,15 @@ const secure = !domain.includes("localhost");
|
|
|
158
158
|
const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
|
|
159
159
|
|
|
160
160
|
const Color = {
|
|
161
|
-
mastercard:
|
|
162
|
-
visa:
|
|
163
|
-
amex:
|
|
164
|
-
orange:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
mastercard: "#ff7f00",
|
|
162
|
+
visa: "#17375E",
|
|
163
|
+
amex: "#348AD5",
|
|
164
|
+
orange: "#ff7f00",
|
|
165
|
+
orangeDark: "#CC4900",
|
|
166
|
+
blue: "#17375E",
|
|
167
|
+
gray: "#D3D3D3",
|
|
168
|
+
gray3: "#a6a5a1",
|
|
169
|
+
gray5: "#e9e9e9",
|
|
168
170
|
};
|
|
169
171
|
const getColor = (name) => {
|
|
170
172
|
return Color[name];
|
|
@@ -2548,10 +2550,15 @@ class EchartComponent {
|
|
|
2548
2550
|
refreshChart() {
|
|
2549
2551
|
this.chart.setOption(this.config);
|
|
2550
2552
|
}
|
|
2553
|
+
resize() {
|
|
2554
|
+
if (this.chart) {
|
|
2555
|
+
setTimeout(() => {
|
|
2556
|
+
this.chart.resize();
|
|
2557
|
+
}, 1);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2551
2560
|
initChart(chartElement) {
|
|
2552
|
-
const observer = new ResizeObserver(
|
|
2553
|
-
this.chart.resize();
|
|
2554
|
-
});
|
|
2561
|
+
const observer = new ResizeObserver(this.resize);
|
|
2555
2562
|
this.chart = echarts.init(chartElement);
|
|
2556
2563
|
this.chart.setOption(this.config);
|
|
2557
2564
|
this.chart.on('click', (params) => {
|
|
@@ -3134,13 +3141,13 @@ class EchartService {
|
|
|
3134
3141
|
},
|
|
3135
3142
|
axisLine: {
|
|
3136
3143
|
show: false,
|
|
3137
|
-
lineStyle: { color: getColor(
|
|
3144
|
+
lineStyle: { color: getColor("gray"), type: "dashed" },
|
|
3138
3145
|
},
|
|
3139
3146
|
splitLine: {
|
|
3140
3147
|
show: showSplitLine,
|
|
3141
3148
|
lineStyle: {
|
|
3142
3149
|
color: Color.gray,
|
|
3143
|
-
type:
|
|
3150
|
+
type: "dashed",
|
|
3144
3151
|
width: 1,
|
|
3145
3152
|
},
|
|
3146
3153
|
},
|
|
@@ -3153,10 +3160,10 @@ class EchartService {
|
|
|
3153
3160
|
};
|
|
3154
3161
|
}
|
|
3155
3162
|
getCategoryAxisConfiguration(data) {
|
|
3156
|
-
return this.getDefultAxisConfiguration(
|
|
3163
|
+
return this.getDefultAxisConfiguration("category", data, true);
|
|
3157
3164
|
}
|
|
3158
3165
|
getValueAxisConfiguration(showAxis = false, format = false, showAxisLines = false) {
|
|
3159
|
-
let axisConfiguration = this.getDefultAxisConfiguration(
|
|
3166
|
+
let axisConfiguration = this.getDefultAxisConfiguration("value", undefined, showAxis, showAxisLines);
|
|
3160
3167
|
if (format) {
|
|
3161
3168
|
axisConfiguration.axisLabel.formatter = (value) => this._sharedService.FormatNumberWithSuffix(value);
|
|
3162
3169
|
}
|
|
@@ -3173,18 +3180,18 @@ class EchartService {
|
|
|
3173
3180
|
}
|
|
3174
3181
|
getGridConfiguration() {
|
|
3175
3182
|
return {
|
|
3176
|
-
left:
|
|
3177
|
-
right:
|
|
3178
|
-
bottom: '
|
|
3183
|
+
left: "0%",
|
|
3184
|
+
right: "0%",
|
|
3185
|
+
//bottom: '0%',
|
|
3179
3186
|
containLabel: true,
|
|
3180
3187
|
};
|
|
3181
3188
|
}
|
|
3182
3189
|
getLegendConfiguration() {
|
|
3183
3190
|
return {
|
|
3184
|
-
orient:
|
|
3185
|
-
icon:
|
|
3191
|
+
orient: "horizontal", // 'horizontal | vertical'
|
|
3192
|
+
icon: "circle",
|
|
3186
3193
|
bottom: 5,
|
|
3187
|
-
align:
|
|
3194
|
+
align: "auto",
|
|
3188
3195
|
itemGap: 20,
|
|
3189
3196
|
textStyle: { color: Color.blue, fontSize: 14 },
|
|
3190
3197
|
};
|
|
@@ -3197,15 +3204,15 @@ class EchartService {
|
|
|
3197
3204
|
yAxis: this.getValueAxisConfiguration(),
|
|
3198
3205
|
series: [
|
|
3199
3206
|
...series.map((item) => ({
|
|
3200
|
-
type:
|
|
3207
|
+
type: "bar",
|
|
3201
3208
|
name: item.name,
|
|
3202
3209
|
itemStyle: { color: item.color },
|
|
3203
3210
|
data: item.value,
|
|
3204
|
-
barWidth:
|
|
3205
|
-
barGap:
|
|
3211
|
+
barWidth: "25%",
|
|
3212
|
+
barGap: "0%",
|
|
3206
3213
|
label: {
|
|
3207
3214
|
show: true,
|
|
3208
|
-
position:
|
|
3215
|
+
position: "top",
|
|
3209
3216
|
color: Color.blue,
|
|
3210
3217
|
fontSize: 12,
|
|
3211
3218
|
formatter: labelConfig,
|
|
@@ -3213,8 +3220,8 @@ class EchartService {
|
|
|
3213
3220
|
})),
|
|
3214
3221
|
],
|
|
3215
3222
|
tooltip: {
|
|
3216
|
-
trigger:
|
|
3217
|
-
backgroundColor:
|
|
3223
|
+
trigger: "item",
|
|
3224
|
+
backgroundColor: "#FFFFFF",
|
|
3218
3225
|
borderWidth: 2,
|
|
3219
3226
|
textStyle: { fontSize: 12 },
|
|
3220
3227
|
formatter: tooltipConfig,
|
|
@@ -3226,10 +3233,10 @@ class EchartService {
|
|
|
3226
3233
|
getBarChartStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3227
3234
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3228
3235
|
barBase.series.forEach((serie, index) => {
|
|
3229
|
-
serie.barWidth =
|
|
3230
|
-
serie.barGap =
|
|
3231
|
-
serie.barCategoryGap =
|
|
3232
|
-
serie.stack =
|
|
3236
|
+
serie.barWidth = "50%";
|
|
3237
|
+
serie.barGap = "0%";
|
|
3238
|
+
serie.barCategoryGap = "10%";
|
|
3239
|
+
serie.stack = "total";
|
|
3233
3240
|
if (index < series.length - 1) {
|
|
3234
3241
|
serie.label = undefined;
|
|
3235
3242
|
}
|
|
@@ -3240,9 +3247,9 @@ class EchartService {
|
|
|
3240
3247
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3241
3248
|
barBase.xAxis = this.getValueAxisConfiguration();
|
|
3242
3249
|
barBase.yAxis = this.getCategoryAxisConfiguration(categories);
|
|
3243
|
-
barBase.series.forEach(
|
|
3250
|
+
barBase.series.forEach(serie => {
|
|
3244
3251
|
if (serie.label) {
|
|
3245
|
-
serie.label.position =
|
|
3252
|
+
serie.label.position = "right";
|
|
3246
3253
|
}
|
|
3247
3254
|
});
|
|
3248
3255
|
return barBase;
|
|
@@ -3250,12 +3257,12 @@ class EchartService {
|
|
|
3250
3257
|
getBarChartHorizontalStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3251
3258
|
let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3252
3259
|
barBase.series.forEach((serie, index) => {
|
|
3253
|
-
serie.barWidth =
|
|
3254
|
-
serie.barGap =
|
|
3255
|
-
serie.barCategoryGap =
|
|
3256
|
-
serie.stack =
|
|
3260
|
+
serie.barWidth = "50%";
|
|
3261
|
+
serie.barGap = "0%";
|
|
3262
|
+
serie.barCategoryGap = "10%";
|
|
3263
|
+
serie.stack = "total";
|
|
3257
3264
|
if (serie.label) {
|
|
3258
|
-
serie.label.position =
|
|
3265
|
+
serie.label.position = "right";
|
|
3259
3266
|
}
|
|
3260
3267
|
if (index < series.length - 1) {
|
|
3261
3268
|
serie.label = undefined;
|
|
@@ -3272,21 +3279,19 @@ class EchartService {
|
|
|
3272
3279
|
barBase.yAxis.axisLabel.color = Color.blue;
|
|
3273
3280
|
barBase.yAxis.axisLabel.fontSize = 12;
|
|
3274
3281
|
barBase.yAxis.axisLabel.width = categoryWidth;
|
|
3275
|
-
barBase.yAxis.axisLabel.overflow =
|
|
3276
|
-
barBase.yAxis.axisLabel.align =
|
|
3277
|
-
barBase.yAxis.axisLabel.verticalAlign =
|
|
3278
|
-
|
|
3279
|
-
barBase.yAxis.axisLabel.margin =
|
|
3280
|
-
categoryWidth + 30;
|
|
3282
|
+
barBase.yAxis.axisLabel.overflow = "break";
|
|
3283
|
+
barBase.yAxis.axisLabel.align = "left";
|
|
3284
|
+
barBase.yAxis.axisLabel.verticalAlign = "middle";
|
|
3285
|
+
barBase.yAxis.axisLabel.margin = categoryWidth + 30;
|
|
3281
3286
|
barBase.yAxis.axisLabel.lineHeight = 16;
|
|
3282
|
-
barBase.grid.top =
|
|
3287
|
+
barBase.grid.top = "0%";
|
|
3283
3288
|
barBase.grid.left = -1 * categoryWidth + 60;
|
|
3284
3289
|
barBase.grid.right = 20;
|
|
3285
|
-
barBase.grid.bottom =
|
|
3290
|
+
barBase.grid.bottom = "0%";
|
|
3286
3291
|
barBase.grid.containLabel = true;
|
|
3287
3292
|
}
|
|
3288
3293
|
barBase.series.forEach((serie, index) => {
|
|
3289
|
-
serie.barWidth =
|
|
3294
|
+
serie.barWidth = "75%";
|
|
3290
3295
|
});
|
|
3291
3296
|
return barBase;
|
|
3292
3297
|
}
|
|
@@ -3297,48 +3302,48 @@ class EchartService {
|
|
|
3297
3302
|
yAxis: this.getValueAxisConfiguration(true, true, true),
|
|
3298
3303
|
series: [
|
|
3299
3304
|
...series.map((item, seriesIndex) => ({
|
|
3300
|
-
type:
|
|
3305
|
+
type: "line",
|
|
3301
3306
|
name: item.name,
|
|
3302
3307
|
data: item.value,
|
|
3303
3308
|
itemStyle: { color: item.color },
|
|
3304
|
-
symbol:
|
|
3309
|
+
symbol: "circle",
|
|
3305
3310
|
symbolSize: 14,
|
|
3306
3311
|
emphasis: {
|
|
3307
3312
|
itemStyle: {
|
|
3308
3313
|
color: item.color,
|
|
3309
|
-
borderColor: item.color +
|
|
3314
|
+
borderColor: item.color + "40", // 40 ( hexadecimal ) = .25 ( decimal )
|
|
3310
3315
|
borderWidth: 16,
|
|
3311
3316
|
},
|
|
3312
3317
|
},
|
|
3313
3318
|
})),
|
|
3314
3319
|
],
|
|
3315
3320
|
tooltip: {
|
|
3316
|
-
trigger:
|
|
3317
|
-
backgroundColor:
|
|
3321
|
+
trigger: "item",
|
|
3322
|
+
backgroundColor: "#FFFFFF",
|
|
3318
3323
|
borderWidth: 2,
|
|
3319
3324
|
textStyle: { fontSize: 12 },
|
|
3320
3325
|
formatter: tooltipConfig,
|
|
3321
3326
|
},
|
|
3322
3327
|
dataZoom: [
|
|
3323
3328
|
{
|
|
3324
|
-
type:
|
|
3329
|
+
type: "inside", // inside | slider
|
|
3325
3330
|
show: true,
|
|
3326
3331
|
height: 12,
|
|
3327
3332
|
bottom: 10,
|
|
3328
|
-
backgroundColor:
|
|
3329
|
-
borderColor:
|
|
3330
|
-
fillerColor:
|
|
3331
|
-
handleSize:
|
|
3333
|
+
backgroundColor: "#ddd",
|
|
3334
|
+
borderColor: "transparent",
|
|
3335
|
+
fillerColor: "rgba(150, 150, 150, 0.5)",
|
|
3336
|
+
handleSize: "80%",
|
|
3332
3337
|
handleStyle: {
|
|
3333
|
-
color:
|
|
3334
|
-
borderColor:
|
|
3338
|
+
color: "#A0A0A0",
|
|
3339
|
+
borderColor: "transparent",
|
|
3335
3340
|
shadowBlur: 2,
|
|
3336
|
-
shadowColor:
|
|
3341
|
+
shadowColor: "rgba(0, 0, 0, 0.2)",
|
|
3337
3342
|
},
|
|
3338
3343
|
showDataShadow: false,
|
|
3339
3344
|
},
|
|
3340
3345
|
{
|
|
3341
|
-
type:
|
|
3346
|
+
type: "inside",
|
|
3342
3347
|
showDataShadow: false,
|
|
3343
3348
|
},
|
|
3344
3349
|
],
|
|
@@ -3350,13 +3355,13 @@ class EchartService {
|
|
|
3350
3355
|
return {
|
|
3351
3356
|
series: [
|
|
3352
3357
|
{
|
|
3353
|
-
data: data.map(
|
|
3358
|
+
data: data.map(item => ({
|
|
3354
3359
|
...item,
|
|
3355
3360
|
itemStyle: { color: item.color },
|
|
3356
3361
|
})),
|
|
3357
|
-
name:
|
|
3358
|
-
type:
|
|
3359
|
-
radius: [
|
|
3362
|
+
name: "Pie Chart",
|
|
3363
|
+
type: "pie",
|
|
3364
|
+
radius: ["40%", "70%"],
|
|
3360
3365
|
avoidLabelOverlap: false,
|
|
3361
3366
|
emphasis: {
|
|
3362
3367
|
scale: true,
|
|
@@ -3368,7 +3373,7 @@ class EchartService {
|
|
|
3368
3373
|
},
|
|
3369
3374
|
label: {
|
|
3370
3375
|
show: true,
|
|
3371
|
-
position:
|
|
3376
|
+
position: "outside",
|
|
3372
3377
|
color: Color.blue,
|
|
3373
3378
|
fontSize: 14,
|
|
3374
3379
|
formatter: labelConfig,
|
|
@@ -3376,43 +3381,43 @@ class EchartService {
|
|
|
3376
3381
|
},
|
|
3377
3382
|
],
|
|
3378
3383
|
tooltip: {
|
|
3379
|
-
trigger:
|
|
3384
|
+
trigger: "item",
|
|
3380
3385
|
formatter: tooltipConfig,
|
|
3381
3386
|
// extraCssText: this.chartService.getTooltipCssText(),
|
|
3382
3387
|
},
|
|
3383
3388
|
legend: {
|
|
3384
|
-
orient:
|
|
3385
|
-
icon:
|
|
3389
|
+
orient: "horizontal", // 'horizontal | vertical'
|
|
3390
|
+
icon: "circle",
|
|
3386
3391
|
bottom: 5,
|
|
3387
|
-
align:
|
|
3392
|
+
align: "auto",
|
|
3388
3393
|
itemGap: 20,
|
|
3389
3394
|
textStyle: { color: Color.blue, fontSize: 14 },
|
|
3390
3395
|
},
|
|
3391
3396
|
};
|
|
3392
3397
|
}
|
|
3393
|
-
getRateDoughnutPieOptions(letter, value, color) {
|
|
3398
|
+
getRateDoughnutPieOptions(letter, value, textSize, color) {
|
|
3394
3399
|
const power = Math.ceil(Math.log10(value));
|
|
3395
3400
|
const placeholderValue = Math.pow(10, power);
|
|
3396
3401
|
const data = [
|
|
3397
3402
|
{ name: letter, value: value, itemStyle: { color: color } },
|
|
3398
3403
|
{
|
|
3399
|
-
name:
|
|
3404
|
+
name: "placeholder",
|
|
3400
3405
|
value: placeholderValue - value,
|
|
3401
|
-
itemStyle: { color: Color.
|
|
3406
|
+
itemStyle: { color: Color.gray5 },
|
|
3402
3407
|
},
|
|
3403
3408
|
];
|
|
3404
3409
|
return {
|
|
3405
3410
|
tooltip: {
|
|
3406
|
-
trigger:
|
|
3411
|
+
trigger: "none",
|
|
3407
3412
|
},
|
|
3408
3413
|
series: [
|
|
3409
3414
|
{
|
|
3410
|
-
name:
|
|
3411
|
-
type:
|
|
3415
|
+
name: "RateDoughnutPie",
|
|
3416
|
+
type: "pie",
|
|
3412
3417
|
tooltip: {
|
|
3413
|
-
trigger:
|
|
3418
|
+
trigger: "none",
|
|
3414
3419
|
},
|
|
3415
|
-
radius: [
|
|
3420
|
+
radius: ["80%", "60%"],
|
|
3416
3421
|
data: data,
|
|
3417
3422
|
startAngle: 0,
|
|
3418
3423
|
selectedMode: false,
|
|
@@ -3421,20 +3426,26 @@ class EchartService {
|
|
|
3421
3426
|
show: true,
|
|
3422
3427
|
formatter: letter,
|
|
3423
3428
|
color: color,
|
|
3424
|
-
|
|
3425
|
-
|
|
3429
|
+
position: "center",
|
|
3430
|
+
fontWeight: "bold",
|
|
3431
|
+
fontSize: textSize,
|
|
3432
|
+
fontFamily: "Arial",
|
|
3433
|
+
lineHeight: textSize * -0.22,
|
|
3434
|
+
align: "center",
|
|
3435
|
+
verticalAlign: "middle",
|
|
3436
|
+
backgroundColor: "transparent",
|
|
3426
3437
|
},
|
|
3427
3438
|
},
|
|
3428
3439
|
],
|
|
3429
3440
|
};
|
|
3430
3441
|
}
|
|
3431
3442
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3432
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn:
|
|
3443
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn: "root" });
|
|
3433
3444
|
}
|
|
3434
3445
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, decorators: [{
|
|
3435
3446
|
type: Injectable,
|
|
3436
3447
|
args: [{
|
|
3437
|
-
providedIn:
|
|
3448
|
+
providedIn: "root",
|
|
3438
3449
|
}]
|
|
3439
3450
|
}] });
|
|
3440
3451
|
|