hfn-components 0.2.8 → 0.2.9
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/es/components/chart/src/HtChart.vue2.mjs +0 -1
- package/es/components/pieChart/index.d.ts +0 -10
- package/es/components/pieChart/src/HtPieChart.d.ts +0 -4
- package/es/components/pieChart/src/HtPieChart.mjs +0 -5
- package/es/components/pieChart/src/HtPieChart.vue.d.ts +0 -10
- package/es/components/pieChart/src/HtPieChart.vue2.mjs +13 -1
- package/es/constants/chartConfig.mjs +1 -2
- package/package.json +1 -1
|
@@ -15,10 +15,6 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
|
|
|
15
15
|
readonly type: StringConstructor;
|
|
16
16
|
readonly default: "";
|
|
17
17
|
};
|
|
18
|
-
readonly customizePercentage: {
|
|
19
|
-
readonly type: BooleanConstructor;
|
|
20
|
-
readonly default: false;
|
|
21
|
-
};
|
|
22
18
|
readonly floatNumber: {
|
|
23
19
|
readonly type: NumberConstructor;
|
|
24
20
|
readonly default: 2;
|
|
@@ -44,7 +40,6 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
|
|
|
44
40
|
readonly lineColor: string[];
|
|
45
41
|
readonly legendData: Record<string, any>;
|
|
46
42
|
readonly legendType: string;
|
|
47
|
-
readonly customizePercentage: boolean;
|
|
48
43
|
readonly legendFormatter: Function;
|
|
49
44
|
} & {}>;
|
|
50
45
|
myChart: import("vue").ShallowRef<any>;
|
|
@@ -72,10 +67,6 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
|
|
|
72
67
|
readonly type: StringConstructor;
|
|
73
68
|
readonly default: "";
|
|
74
69
|
};
|
|
75
|
-
readonly customizePercentage: {
|
|
76
|
-
readonly type: BooleanConstructor;
|
|
77
|
-
readonly default: false;
|
|
78
|
-
};
|
|
79
70
|
readonly floatNumber: {
|
|
80
71
|
readonly type: NumberConstructor;
|
|
81
72
|
readonly default: 2;
|
|
@@ -100,7 +91,6 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
|
|
|
100
91
|
readonly lineColor: string[];
|
|
101
92
|
readonly legendData: Record<string, any>;
|
|
102
93
|
readonly legendType: string;
|
|
103
|
-
readonly customizePercentage: boolean;
|
|
104
94
|
readonly legendFormatter: Function;
|
|
105
95
|
}, {}>> & Record<string, any>;
|
|
106
96
|
export default HtPieChart;
|
|
@@ -16,10 +16,6 @@ export declare const pieProps: {
|
|
|
16
16
|
readonly type: StringConstructor;
|
|
17
17
|
readonly default: "";
|
|
18
18
|
};
|
|
19
|
-
readonly customizePercentage: {
|
|
20
|
-
readonly type: BooleanConstructor;
|
|
21
|
-
readonly default: false;
|
|
22
|
-
};
|
|
23
19
|
readonly floatNumber: {
|
|
24
20
|
readonly type: NumberConstructor;
|
|
25
21
|
readonly default: 2;
|
|
@@ -15,10 +15,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
readonly type: StringConstructor;
|
|
16
16
|
readonly default: "";
|
|
17
17
|
};
|
|
18
|
-
readonly customizePercentage: {
|
|
19
|
-
readonly type: BooleanConstructor;
|
|
20
|
-
readonly default: false;
|
|
21
|
-
};
|
|
22
18
|
readonly floatNumber: {
|
|
23
19
|
readonly type: NumberConstructor;
|
|
24
20
|
readonly default: 2;
|
|
@@ -44,7 +40,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
40
|
readonly lineColor: string[];
|
|
45
41
|
readonly legendData: Record<string, any>;
|
|
46
42
|
readonly legendType: string;
|
|
47
|
-
readonly customizePercentage: boolean;
|
|
48
43
|
readonly legendFormatter: Function;
|
|
49
44
|
} & {}>;
|
|
50
45
|
myChart: import("vue").ShallowRef<any>;
|
|
@@ -72,10 +67,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
72
67
|
readonly type: StringConstructor;
|
|
73
68
|
readonly default: "";
|
|
74
69
|
};
|
|
75
|
-
readonly customizePercentage: {
|
|
76
|
-
readonly type: BooleanConstructor;
|
|
77
|
-
readonly default: false;
|
|
78
|
-
};
|
|
79
70
|
readonly floatNumber: {
|
|
80
71
|
readonly type: NumberConstructor;
|
|
81
72
|
readonly default: 2;
|
|
@@ -100,7 +91,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
91
|
readonly lineColor: string[];
|
|
101
92
|
readonly legendData: Record<string, any>;
|
|
102
93
|
readonly legendType: string;
|
|
103
|
-
readonly customizePercentage: boolean;
|
|
104
94
|
readonly legendFormatter: Function;
|
|
105
95
|
}, {}>;
|
|
106
96
|
export default _default;
|
|
@@ -26,6 +26,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
chartResize();
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
|
+
watch(
|
|
30
|
+
() => props.lineColor,
|
|
31
|
+
(val) => {
|
|
32
|
+
if (val && val.length > 0) {
|
|
33
|
+
echartOptions.color = props.lineColor;
|
|
34
|
+
if (myChart.value) {
|
|
35
|
+
echartInit();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{ deep: true, immediate: true }
|
|
40
|
+
);
|
|
29
41
|
const chartResize = () => {
|
|
30
42
|
myChart.value.resize();
|
|
31
43
|
};
|
|
@@ -60,7 +72,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
72
|
let html;
|
|
61
73
|
html = `<div>${params.seriesName}</div>`;
|
|
62
74
|
html += `<span> ${params.name}:
|
|
63
|
-
${
|
|
75
|
+
${params.data.percent ? (params.data.percent * 100).toFixed(props.floatNumber) : params.percent.toFixed(props.floatNumber)}%<span>`;
|
|
64
76
|
return html;
|
|
65
77
|
}
|
|
66
78
|
};
|
|
@@ -95,8 +95,7 @@ const BASIC_PIE_CONFIG = {
|
|
|
95
95
|
label: {
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
97
|
formatter: function(params) {
|
|
98
|
-
|
|
99
|
-
const val = params.percent.toFixed(2);
|
|
98
|
+
const val = params.data.percent ? (params.data.percent * 100).toFixed(2) : params.percent.toFixed(2);
|
|
100
99
|
return ` ${params.name}: ${val}%`;
|
|
101
100
|
},
|
|
102
101
|
fontWeight: "bolder",
|