hfn-components 0.1.3 → 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.
@@ -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: "";
@@ -53,6 +53,11 @@ const chartProps = {
53
53
  type: String,
54
54
  default: ""
55
55
  },
56
+ //Y轴单位
57
+ yAxisUnit: {
58
+ type: String,
59
+ default: ""
60
+ },
56
61
  //tooltip单位
57
62
  tooltipUnit: {
58
63
  type: String,
@@ -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;
@@ -87,7 +87,7 @@ const setEchartYAxis = (options, props) => {
87
87
  show: true,
88
88
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
89
  formatter: function(val) {
90
- return (props.isReturn ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + `${props.isReturn ? "%" : ""}`;
90
+ return (props.yAxisUnit === "%" ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + props.yAxisUnit;
91
91
  }
92
92
  }
93
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",