hfn-components 0.1.2 → 0.1.3
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.
|
@@ -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.isReturn ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + `${props.isReturn ? "%" : ""}`;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
};
|