intelica-library-ui 0.1.82 → 0.1.83
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.
|
@@ -3182,6 +3182,7 @@ class EchartService {
|
|
|
3182
3182
|
};
|
|
3183
3183
|
}
|
|
3184
3184
|
/// Charts Configuration
|
|
3185
|
+
/// BAR CHARTS
|
|
3185
3186
|
getBarChartOptions(categories, series, labelConfig, tooltipConfig) {
|
|
3186
3187
|
return {
|
|
3187
3188
|
xAxis: this.getCategoryAxisConfiguration(categories),
|
|
@@ -3254,8 +3255,117 @@ class EchartService {
|
|
|
3254
3255
|
});
|
|
3255
3256
|
return barBase;
|
|
3256
3257
|
}
|
|
3257
|
-
|
|
3258
|
-
|
|
3258
|
+
/// LINE CHARTS
|
|
3259
|
+
getLineChartOptions(categories, series, labelConfig, tooltipConfig) {
|
|
3260
|
+
return {
|
|
3261
|
+
xAxis: this.getCategoryAxisConfiguration(categories),
|
|
3262
|
+
yAxis: this.getValueAxisConfiguration(true, true, true),
|
|
3263
|
+
series: [
|
|
3264
|
+
...series.map((item, seriesIndex) => ({
|
|
3265
|
+
type: 'line',
|
|
3266
|
+
name: item.name,
|
|
3267
|
+
data: item.value,
|
|
3268
|
+
itemStyle: { color: item.color },
|
|
3269
|
+
symbol: 'circle',
|
|
3270
|
+
symbolSize: 14,
|
|
3271
|
+
emphasis: {
|
|
3272
|
+
itemStyle: {
|
|
3273
|
+
color: item.color,
|
|
3274
|
+
borderColor: item.color + '40', // 40 ( hexadecimal ) = .25 ( decimal )
|
|
3275
|
+
borderWidth: 16,
|
|
3276
|
+
},
|
|
3277
|
+
},
|
|
3278
|
+
})),
|
|
3279
|
+
],
|
|
3280
|
+
tooltip: {
|
|
3281
|
+
trigger: 'item',
|
|
3282
|
+
backgroundColor: '#FFFFFF',
|
|
3283
|
+
borderWidth: 2,
|
|
3284
|
+
textStyle: { fontSize: 12 },
|
|
3285
|
+
formatter: tooltipConfig,
|
|
3286
|
+
},
|
|
3287
|
+
dataZoom: [
|
|
3288
|
+
{
|
|
3289
|
+
type: 'inside', // inside | slider
|
|
3290
|
+
show: true,
|
|
3291
|
+
height: 12,
|
|
3292
|
+
bottom: 10,
|
|
3293
|
+
backgroundColor: '#ddd',
|
|
3294
|
+
borderColor: 'transparent',
|
|
3295
|
+
fillerColor: 'rgba(150, 150, 150, 0.5)',
|
|
3296
|
+
handleSize: '80%',
|
|
3297
|
+
handleStyle: {
|
|
3298
|
+
color: '#A0A0A0',
|
|
3299
|
+
borderColor: 'transparent',
|
|
3300
|
+
shadowBlur: 2,
|
|
3301
|
+
shadowColor: 'rgba(0, 0, 0, 0.2)',
|
|
3302
|
+
},
|
|
3303
|
+
showDataShadow: false,
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
type: 'inside',
|
|
3307
|
+
showDataShadow: false,
|
|
3308
|
+
},
|
|
3309
|
+
],
|
|
3310
|
+
legend: this.getLegendConfiguration(),
|
|
3311
|
+
};
|
|
3312
|
+
}
|
|
3313
|
+
/// PIE CHARTS
|
|
3314
|
+
getDoughnutPieOptions(data, labelConfig, tooltipConfig) {
|
|
3315
|
+
return {
|
|
3316
|
+
series: [
|
|
3317
|
+
{
|
|
3318
|
+
data: data.map((item) => ({
|
|
3319
|
+
...item,
|
|
3320
|
+
itemStyle: { color: item.color },
|
|
3321
|
+
})),
|
|
3322
|
+
name: 'Pie Chart',
|
|
3323
|
+
type: 'pie',
|
|
3324
|
+
radius: ['40%', '70%'],
|
|
3325
|
+
avoidLabelOverlap: false,
|
|
3326
|
+
emphasis: {
|
|
3327
|
+
scale: true,
|
|
3328
|
+
},
|
|
3329
|
+
labelLine: {
|
|
3330
|
+
show: true,
|
|
3331
|
+
length: 15,
|
|
3332
|
+
length2: 20,
|
|
3333
|
+
},
|
|
3334
|
+
label: {
|
|
3335
|
+
show: true,
|
|
3336
|
+
position: 'outside',
|
|
3337
|
+
color: Color.blue,
|
|
3338
|
+
fontSize: 14,
|
|
3339
|
+
formatter: labelConfig,
|
|
3340
|
+
},
|
|
3341
|
+
},
|
|
3342
|
+
],
|
|
3343
|
+
tooltip: {
|
|
3344
|
+
trigger: 'item',
|
|
3345
|
+
formatter: tooltipConfig,
|
|
3346
|
+
// extraCssText: this.chartService.getTooltipCssText(),
|
|
3347
|
+
},
|
|
3348
|
+
legend: {
|
|
3349
|
+
orient: 'horizontal', // 'horizontal | vertical'
|
|
3350
|
+
icon: 'circle',
|
|
3351
|
+
bottom: 5,
|
|
3352
|
+
align: 'auto',
|
|
3353
|
+
itemGap: 20,
|
|
3354
|
+
textStyle: { color: Color.blue, fontSize: 14 },
|
|
3355
|
+
},
|
|
3356
|
+
};
|
|
3357
|
+
}
|
|
3358
|
+
getRateDoughnutPieOptions(letter, value, color) {
|
|
3359
|
+
const power = Math.ceil(Math.log10(value));
|
|
3360
|
+
const placeholderValue = Math.pow(10, power);
|
|
3361
|
+
const data = [
|
|
3362
|
+
{ name: letter, value: value, itemStyle: { color: color } },
|
|
3363
|
+
{
|
|
3364
|
+
name: 'placeholder',
|
|
3365
|
+
value: placeholderValue - value,
|
|
3366
|
+
itemStyle: { color: Color.gray },
|
|
3367
|
+
},
|
|
3368
|
+
];
|
|
3259
3369
|
return {
|
|
3260
3370
|
tooltip: {
|
|
3261
3371
|
trigger: 'none',
|
|
@@ -3274,10 +3384,8 @@ class EchartService {
|
|
|
3274
3384
|
silent: true,
|
|
3275
3385
|
label: {
|
|
3276
3386
|
show: true,
|
|
3277
|
-
formatter:
|
|
3278
|
-
|
|
3279
|
-
},
|
|
3280
|
-
color: rateData.itemStyle.color,
|
|
3387
|
+
formatter: letter,
|
|
3388
|
+
color: color,
|
|
3281
3389
|
fontSize: '40',
|
|
3282
3390
|
position: 'center',
|
|
3283
3391
|
},
|