intelica-library-ui 0.1.89 → 0.1.90
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.
|
@@ -3168,15 +3168,6 @@ class EchartService {
|
|
|
3168
3168
|
}
|
|
3169
3169
|
return axisConfiguration;
|
|
3170
3170
|
}
|
|
3171
|
-
getTooltipFormatter(color, title, body) {
|
|
3172
|
-
return `
|
|
3173
|
-
<div style="font-size: 12px; color: ${color}; border-radius: 6px; min-width: 120px; text-align: center;">
|
|
3174
|
-
<b style=" font-size: 13px;">${title} </b><br>
|
|
3175
|
-
<hr style="border: 1px solid ${color}; margin: 4px 0;">
|
|
3176
|
-
${body}
|
|
3177
|
-
</div>
|
|
3178
|
-
`;
|
|
3179
|
-
}
|
|
3180
3171
|
getGridConfiguration() {
|
|
3181
3172
|
return {
|
|
3182
3173
|
left: "0%",
|
|
@@ -3195,8 +3186,33 @@ class EchartService {
|
|
|
3195
3186
|
textStyle: { color: Color.blue, fontSize: 14 },
|
|
3196
3187
|
};
|
|
3197
3188
|
}
|
|
3189
|
+
/**
|
|
3190
|
+
*
|
|
3191
|
+
* @param color - Color of the tooltip
|
|
3192
|
+
* @param title - Title of the tooltip
|
|
3193
|
+
* @param body - Body of the tooltip
|
|
3194
|
+
* @returns - Tooltip HTML string
|
|
3195
|
+
*/
|
|
3196
|
+
getTooltipFormatter(color, title, body) {
|
|
3197
|
+
return `
|
|
3198
|
+
<div style="font-size: 12px; color: ${color}; border-radius: 6px; min-width: 120px; text-align: center;">
|
|
3199
|
+
<b style=" font-size: 13px;">${title} </b><br>
|
|
3200
|
+
<hr style="border: 1px solid ${color}; margin: 4px 0;">
|
|
3201
|
+
${body}
|
|
3202
|
+
</div>
|
|
3203
|
+
`;
|
|
3204
|
+
}
|
|
3198
3205
|
/// Charts Configuration
|
|
3199
3206
|
/// BAR CHARTS
|
|
3207
|
+
/**
|
|
3208
|
+
*
|
|
3209
|
+
* @param categories - Array of categories for the x-axis
|
|
3210
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3211
|
+
* @param labelConfig - Optional label configuration for the bars
|
|
3212
|
+
* @param tooltipConfig - Optional tooltip configuration for the bars
|
|
3213
|
+
* @param showLegend - Optional flag to show the legend
|
|
3214
|
+
* @returns - EChartsOption - Configuration object for the bar chart
|
|
3215
|
+
*/
|
|
3200
3216
|
getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3201
3217
|
return {
|
|
3202
3218
|
xAxis: this.getCategoryAxisConfiguration(categories),
|
|
@@ -3229,6 +3245,15 @@ class EchartService {
|
|
|
3229
3245
|
legend: showLegend ? this.getLegendConfiguration() : undefined,
|
|
3230
3246
|
};
|
|
3231
3247
|
}
|
|
3248
|
+
/**
|
|
3249
|
+
*
|
|
3250
|
+
* @param categories - Array of categories for the x-axis
|
|
3251
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3252
|
+
* @param labelConfig - Optional label configuration for the bars
|
|
3253
|
+
* @param tooltipConfig - Optional tooltip configuration for the bars
|
|
3254
|
+
* @param showLegend - Optional flag to show the legend
|
|
3255
|
+
* @returns - EChartsOption - Configuration object for the bar chart
|
|
3256
|
+
*/
|
|
3232
3257
|
getBarChartStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3233
3258
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3234
3259
|
barBase.series.forEach((serie, index) => {
|
|
@@ -3242,6 +3267,15 @@ class EchartService {
|
|
|
3242
3267
|
});
|
|
3243
3268
|
return barBase;
|
|
3244
3269
|
}
|
|
3270
|
+
/**
|
|
3271
|
+
*
|
|
3272
|
+
* @param categories - Array of categories for the y-axis
|
|
3273
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3274
|
+
* @param labelConfig - Optional label configuration for the bars
|
|
3275
|
+
* @param tooltipConfig - Optional tooltip configuration for the bars
|
|
3276
|
+
* @param showLegend - Optional flag to show the legend
|
|
3277
|
+
* @returns - EChartsOption - Configuration object for the bar chart
|
|
3278
|
+
*/
|
|
3245
3279
|
getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3246
3280
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3247
3281
|
barBase.xAxis = this.getValueAxisConfiguration();
|
|
@@ -3251,8 +3285,23 @@ class EchartService {
|
|
|
3251
3285
|
serie.label.position = "right";
|
|
3252
3286
|
}
|
|
3253
3287
|
});
|
|
3288
|
+
if (barBase.grid) {
|
|
3289
|
+
barBase.grid.left = "10%";
|
|
3290
|
+
barBase.grid.right = "10%";
|
|
3291
|
+
barBase.grid.bottom = "10%";
|
|
3292
|
+
barBase.grid.containLabel = true;
|
|
3293
|
+
}
|
|
3254
3294
|
return barBase;
|
|
3255
3295
|
}
|
|
3296
|
+
/**
|
|
3297
|
+
*
|
|
3298
|
+
* @param categories - Array of categories for the y-axis
|
|
3299
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3300
|
+
* @param labelConfig - Optional label configuration for the bars
|
|
3301
|
+
* @param tooltipConfig - Optional tooltip configuration for the bars
|
|
3302
|
+
* @param showLegend - Optional flag to show the legend
|
|
3303
|
+
* @returns - EChartsOption - Configuration object for the bar chart
|
|
3304
|
+
*/
|
|
3256
3305
|
getBarChartHorizontalStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3257
3306
|
let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3258
3307
|
barBase.series.forEach((serie, index) => {
|
|
@@ -3267,13 +3316,26 @@ class EchartService {
|
|
|
3267
3316
|
serie.label = undefined;
|
|
3268
3317
|
}
|
|
3269
3318
|
});
|
|
3319
|
+
if (barBase.grid) {
|
|
3320
|
+
barBase.grid.left = "10%";
|
|
3321
|
+
barBase.grid.right = "10%";
|
|
3322
|
+
barBase.grid.bottom = "10%";
|
|
3323
|
+
barBase.grid.containLabel = true;
|
|
3324
|
+
}
|
|
3270
3325
|
return barBase;
|
|
3271
3326
|
}
|
|
3327
|
+
/**
|
|
3328
|
+
*
|
|
3329
|
+
* @param categories - Array of categories for the y-axis
|
|
3330
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3331
|
+
* @param labelConfig - Optional label configuration for the bars
|
|
3332
|
+
* @param tooltipConfig - Optional tooltip configuration for the bars
|
|
3333
|
+
* @param showLegend - Optional flag to show the legend
|
|
3334
|
+
* @returns - EChartsOption - Configuration object for the bar chart
|
|
3335
|
+
*/
|
|
3272
3336
|
getBarChartTopOptions(categories, series, categoryWidth = 240, labelConfig, tooltipConfig, showLegend = false) {
|
|
3273
3337
|
let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3274
3338
|
if (barBase.yAxis) {
|
|
3275
|
-
// (barBase.yAxis as YAXisComponentOption).show = true;
|
|
3276
|
-
// (barBase.yAxis as YAXisComponentOption).splitLine!.show = true;
|
|
3277
3339
|
barBase.yAxis.inverse = true;
|
|
3278
3340
|
barBase.yAxis.axisLabel.color = Color.blue;
|
|
3279
3341
|
barBase.yAxis.axisLabel.fontSize = 12;
|
|
@@ -3295,6 +3357,15 @@ class EchartService {
|
|
|
3295
3357
|
return barBase;
|
|
3296
3358
|
}
|
|
3297
3359
|
/// LINE CHARTS
|
|
3360
|
+
/**
|
|
3361
|
+
*
|
|
3362
|
+
* @param categories - Array of categories for the x-axis
|
|
3363
|
+
* @param series - Array of series data, each containing name, value, and color
|
|
3364
|
+
* @param labelConfig - Optional label configuration for the lines
|
|
3365
|
+
* @param tooltipConfig - Optional tooltip configuration for the lines
|
|
3366
|
+
* @param showLegend - Optional flag to show the legend
|
|
3367
|
+
* @returns - EChartsOption - Configuration object for the line chart
|
|
3368
|
+
*/
|
|
3298
3369
|
getLineChartOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3299
3370
|
return {
|
|
3300
3371
|
xAxis: this.getCategoryAxisConfiguration(categories),
|
|
@@ -3350,6 +3421,13 @@ class EchartService {
|
|
|
3350
3421
|
};
|
|
3351
3422
|
}
|
|
3352
3423
|
/// PIE CHARTS
|
|
3424
|
+
/**
|
|
3425
|
+
*
|
|
3426
|
+
* @param data - Array of series data, each containing name, value, and color
|
|
3427
|
+
* @param labelConfig - Optional label configuration
|
|
3428
|
+
* @param tooltipConfig - Optional tooltip configuration
|
|
3429
|
+
* @returns - EChartsOption - Configuration object for the pie
|
|
3430
|
+
*/
|
|
3353
3431
|
getDoughnutPieOptions(data, labelConfig, tooltipConfig) {
|
|
3354
3432
|
return {
|
|
3355
3433
|
series: [
|
|
@@ -3394,6 +3472,14 @@ class EchartService {
|
|
|
3394
3472
|
},
|
|
3395
3473
|
};
|
|
3396
3474
|
}
|
|
3475
|
+
/**
|
|
3476
|
+
*
|
|
3477
|
+
* @param letter - text to show in the center of the pie
|
|
3478
|
+
* @param value - rate value
|
|
3479
|
+
* @param textSize - size of the letter
|
|
3480
|
+
* @param color - color of the letter and pie
|
|
3481
|
+
* @returns
|
|
3482
|
+
*/
|
|
3397
3483
|
getRateDoughnutPieOptions(letter, value, textSize, color) {
|
|
3398
3484
|
const power = Math.ceil(Math.log10(value));
|
|
3399
3485
|
const placeholderValue = Math.pow(10, power);
|