mrxy-yk 1.9.8 → 1.9.10
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.
|
@@ -5,13 +5,22 @@ import { PieSeriesOption } from 'echarts';
|
|
|
5
5
|
* 饼图配置
|
|
6
6
|
*/
|
|
7
7
|
export declare class EcPieOption extends EcBasicOption {
|
|
8
|
+
/**
|
|
9
|
+
* 单位
|
|
10
|
+
*/
|
|
8
11
|
unit?: string;
|
|
9
12
|
/**
|
|
10
13
|
* 格式化图例
|
|
11
14
|
* {name}{unit}{value}{percent}
|
|
12
15
|
*/
|
|
13
16
|
lengthFormatter?: PieModule.ConstructorOption['lengthFormatter'];
|
|
17
|
+
/**
|
|
18
|
+
* 是否显示中心标签数据
|
|
19
|
+
*/
|
|
14
20
|
showCenterLabelData?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 中心标签数据
|
|
23
|
+
*/
|
|
15
24
|
centerLabelData: number;
|
|
16
25
|
constructor(option?: PieModule.ConstructorOption);
|
|
17
26
|
/**
|
|
@@ -9,13 +9,22 @@ import "echarts";
|
|
|
9
9
|
* 饼图配置
|
|
10
10
|
*/
|
|
11
11
|
var EcPieOption = class extends EcBasicOption {
|
|
12
|
+
/**
|
|
13
|
+
* 单位
|
|
14
|
+
*/
|
|
12
15
|
unit = void 0;
|
|
13
16
|
/**
|
|
14
17
|
* 格式化图例
|
|
15
18
|
* {name}{unit}{value}{percent}
|
|
16
19
|
*/
|
|
17
20
|
lengthFormatter = void 0;
|
|
21
|
+
/**
|
|
22
|
+
* 是否显示中心标签数据
|
|
23
|
+
*/
|
|
18
24
|
showCenterLabelData = false;
|
|
25
|
+
/**
|
|
26
|
+
* 中心标签数据
|
|
27
|
+
*/
|
|
19
28
|
centerLabelData = 0;
|
|
20
29
|
constructor(option) {
|
|
21
30
|
const { unit, name, lengthFormatter, showCenterLabelData, labelDataFractionDigits = 2, labelFormatter, series: seriesOption = {}, option: ecOptionBasicOption } = option || {};
|
|
@@ -57,10 +66,15 @@ var EcPieOption = class extends EcBasicOption {
|
|
|
57
66
|
seriesOption.label = ObjectUtil.assignDeep(seriesLabel, seriesOption.label || {});
|
|
58
67
|
const series = [new EcPieSeries({
|
|
59
68
|
unit,
|
|
60
|
-
series:
|
|
69
|
+
series: {
|
|
70
|
+
center: option.center,
|
|
71
|
+
radius: option.radius,
|
|
72
|
+
...seriesOption
|
|
73
|
+
}
|
|
61
74
|
})];
|
|
62
75
|
delete option?.option?.series;
|
|
63
76
|
const defaultOption = assignEcOptionBasicOption({
|
|
77
|
+
color: option.color,
|
|
64
78
|
legend: [{
|
|
65
79
|
right: 15,
|
|
66
80
|
top: "center",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BarSeriesOption, EChartsOption, LineSeriesOption, PictorialBarSeriesOption, SeriesOption, RadarSeriesOption } from 'echarts';
|
|
1
|
+
import { BarSeriesOption, EChartsOption, LineSeriesOption, PieSeriesOption, PictorialBarSeriesOption, SeriesOption, RadarSeriesOption } from 'echarts';
|
|
2
2
|
import { EcBasicSeries } from '.';
|
|
3
3
|
// region 根配置
|
|
4
4
|
export type EcOptionBasicOption = Omit<EChartsOption, 'series'> & {
|
|
@@ -75,6 +75,12 @@ export namespace PieModule {
|
|
|
75
75
|
export type ConstructorOption = SeriesConstructorOption & {
|
|
76
76
|
// 单位
|
|
77
77
|
unit?: string
|
|
78
|
+
// 颜色
|
|
79
|
+
color?: string[]
|
|
80
|
+
// 环形饼图内外圆心半径
|
|
81
|
+
radius?: string | number | (string | number)[]
|
|
82
|
+
// 圆心位置
|
|
83
|
+
center?: string | number | (string | number)[]
|
|
78
84
|
/**
|
|
79
85
|
* 格式化图例
|
|
80
86
|
* @example
|