hfn-components 0.1.1 → 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.
@@ -9,7 +9,10 @@ const _hoisted_2 = {
9
9
  };
10
10
  const _hoisted_3 = ["onClick", "onMouseover"];
11
11
  const _hoisted_4 = ["id"];
12
- const _hoisted_5 = { key: 1 };
12
+ const _hoisted_5 = {
13
+ key: 1,
14
+ class: "noData"
15
+ };
13
16
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
14
17
  return openBlock(), createElementBlock("div", _hoisted_1, [
15
18
  _ctx.showLegend && !$setup.isEmpty ? (openBlock(), createElementBlock("div", _hoisted_2, [
@@ -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();
@@ -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;
@@ -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
  };
@@ -131,7 +131,7 @@ const setEchartTooltip = (options, props) => {
131
131
  ">
132
132
  </span>`;
133
133
  if (props.isReturn) {
134
- html += `<span style='color:${params[i].color}'>${params[i].seriesName}</span>\uFF1A${params[i].value[2]?.toFixed(props.floatNumber)}\uFF08${params[i].value[1] > 0 ? "+" : ""}${params[i].value[1].toFixed(2)}%\uFF09`;
134
+ html += `<span style='color:${params[i].color}'>${params[i].seriesName}</span>\uFF1A${params[i].value[2]?.toFixed(props.floatNumber)}\uFF08${params[i].value[1] > 0 ? "+" : ""}${params[i].value[1]}%\uFF09`;
135
135
  } else {
136
136
  if (props.chartType === "category") {
137
137
  html += `<span style='color:${params[i].color}'>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",