hfn-components 0.1.2 → 0.1.4
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/index.d.ts +10 -0
- package/es/components/chart/src/HtChart.d.ts +4 -0
- package/es/components/chart/src/HtChart.mjs +5 -0
- package/es/components/chart/src/HtChart.vue.d.ts +10 -0
- package/es/components/chart/src/HtChart.vue2.mjs +1 -1
- package/es/utils/chart.d.ts +1 -1
- package/es/utils/chart.mjs +2 -2
- package/package.json +1 -1
|
@@ -35,6 +35,10 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
|
|
|
35
35
|
readonly type: StringConstructor;
|
|
36
36
|
readonly default: "";
|
|
37
37
|
};
|
|
38
|
+
readonly yAxisUnit: {
|
|
39
|
+
readonly type: StringConstructor;
|
|
40
|
+
readonly default: "";
|
|
41
|
+
};
|
|
38
42
|
readonly tooltipUnit: {
|
|
39
43
|
readonly type: StringConstructor;
|
|
40
44
|
readonly default: "";
|
|
@@ -62,6 +66,7 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
|
|
|
62
66
|
readonly isPercent: boolean;
|
|
63
67
|
readonly floatNumber: number;
|
|
64
68
|
readonly titleText: string;
|
|
69
|
+
readonly yAxisUnit: string;
|
|
65
70
|
readonly tooltipUnit: string;
|
|
66
71
|
readonly watchResize: boolean;
|
|
67
72
|
readonly showLegend: boolean;
|
|
@@ -116,6 +121,10 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
|
|
|
116
121
|
readonly type: StringConstructor;
|
|
117
122
|
readonly default: "";
|
|
118
123
|
};
|
|
124
|
+
readonly yAxisUnit: {
|
|
125
|
+
readonly type: StringConstructor;
|
|
126
|
+
readonly default: "";
|
|
127
|
+
};
|
|
119
128
|
readonly tooltipUnit: {
|
|
120
129
|
readonly type: StringConstructor;
|
|
121
130
|
readonly default: "";
|
|
@@ -142,6 +151,7 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
|
|
|
142
151
|
readonly isPercent: boolean;
|
|
143
152
|
readonly floatNumber: number;
|
|
144
153
|
readonly titleText: string;
|
|
154
|
+
readonly yAxisUnit: string;
|
|
145
155
|
readonly tooltipUnit: string;
|
|
146
156
|
readonly watchResize: boolean;
|
|
147
157
|
readonly showLegend: boolean;
|
|
@@ -37,6 +37,10 @@ export declare const chartProps: {
|
|
|
37
37
|
readonly type: StringConstructor;
|
|
38
38
|
readonly default: "";
|
|
39
39
|
};
|
|
40
|
+
readonly yAxisUnit: {
|
|
41
|
+
readonly type: StringConstructor;
|
|
42
|
+
readonly default: "";
|
|
43
|
+
};
|
|
40
44
|
readonly tooltipUnit: {
|
|
41
45
|
readonly type: StringConstructor;
|
|
42
46
|
readonly default: "";
|
|
@@ -42,6 +42,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
readonly type: StringConstructor;
|
|
43
43
|
readonly default: "";
|
|
44
44
|
};
|
|
45
|
+
readonly yAxisUnit: {
|
|
46
|
+
readonly type: StringConstructor;
|
|
47
|
+
readonly default: "";
|
|
48
|
+
};
|
|
45
49
|
readonly tooltipUnit: {
|
|
46
50
|
readonly type: StringConstructor;
|
|
47
51
|
readonly default: "";
|
|
@@ -69,6 +73,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
73
|
readonly isPercent: boolean;
|
|
70
74
|
readonly floatNumber: number;
|
|
71
75
|
readonly titleText: string;
|
|
76
|
+
readonly yAxisUnit: string;
|
|
72
77
|
readonly tooltipUnit: string;
|
|
73
78
|
readonly watchResize: boolean;
|
|
74
79
|
readonly showLegend: boolean;
|
|
@@ -123,6 +128,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
123
128
|
readonly type: StringConstructor;
|
|
124
129
|
readonly default: "";
|
|
125
130
|
};
|
|
131
|
+
readonly yAxisUnit: {
|
|
132
|
+
readonly type: StringConstructor;
|
|
133
|
+
readonly default: "";
|
|
134
|
+
};
|
|
126
135
|
readonly tooltipUnit: {
|
|
127
136
|
readonly type: StringConstructor;
|
|
128
137
|
readonly default: "";
|
|
@@ -149,6 +158,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
149
158
|
readonly isPercent: boolean;
|
|
150
159
|
readonly floatNumber: number;
|
|
151
160
|
readonly titleText: string;
|
|
161
|
+
readonly yAxisUnit: string;
|
|
152
162
|
readonly tooltipUnit: string;
|
|
153
163
|
readonly watchResize: boolean;
|
|
154
164
|
readonly showLegend: boolean;
|
|
@@ -32,7 +32,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
32
|
);
|
|
33
33
|
const drawGraph = () => {
|
|
34
34
|
setEchartXAxis(echartOptions, props.chartType, props.xAxisData);
|
|
35
|
-
setEchartYAxis(echartOptions);
|
|
35
|
+
setEchartYAxis(echartOptions, props);
|
|
36
36
|
setEchartTooltip(echartOptions, props);
|
|
37
37
|
lengedDeal();
|
|
38
38
|
echartInit();
|
package/es/utils/chart.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export type chartType = 'category' | 'time';
|
|
|
3
3
|
export declare const legendEnterOperate: (options: any, name: string) => void;
|
|
4
4
|
export declare const legendLeaveOperate: (options: any) => void;
|
|
5
5
|
export declare const setEchartXAxis: (options: any, type: chartType, xAxisData: string[]) => void;
|
|
6
|
-
export declare const setEchartYAxis: (options: any) => void;
|
|
6
|
+
export declare const setEchartYAxis: (options: any, props: chartProp) => void;
|
|
7
7
|
export declare const setEchartTooltip: (options: any, props: chartProp) => void;
|
package/es/utils/chart.mjs
CHANGED
|
@@ -80,14 +80,14 @@ const setEchartXAxis = (options, type, xAxisData) => {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
const setEchartYAxis = (options) => {
|
|
83
|
+
const setEchartYAxis = (options, props) => {
|
|
84
84
|
options.yAxis = {
|
|
85
85
|
type: "value",
|
|
86
86
|
axisLabel: {
|
|
87
87
|
show: true,
|
|
88
88
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
89
|
formatter: function(val) {
|
|
90
|
-
return "" + val;
|
|
90
|
+
return (props.yAxisUnit === "%" ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + props.yAxisUnit;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
};
|