hfn-components 0.2.0 → 0.2.2

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.
@@ -34,11 +34,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  () => props.lineColor,
35
35
  () => {
36
36
  echartOptions.color = props.lineColor;
37
- echartInit();
37
+ if (myChart.value) {
38
+ echartInit();
39
+ }
38
40
  },
39
41
  { deep: true, immediate: true }
40
42
  );
41
43
  const drawGraph = () => {
44
+ echartOptions.color = props.lineColor;
42
45
  setEchartXAxis(echartOptions, props.chartType, props.xAxisData);
43
46
  setEchartYAxis(echartOptions, props);
44
47
  setEchartTooltip(echartOptions, props);
@@ -61,7 +64,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
61
64
  setTimeout(() => {
62
65
  if (!myChart.value) {
63
66
  const ele = document.getElementById(props.chartId);
64
- myChart.value = echarts.init(ele, null, { devicePixelRatio: 2 });
67
+ myChart.value = echarts.init(ele, null, { devicePixelRatio: 2, locale: "ZH" });
65
68
  }
66
69
  myChart.value.setOption(echartOptions, true);
67
70
  }, 200);
@@ -131,7 +131,16 @@ 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]}%\uFF09`;
134
+ if (
135
+ // params[i].seriesId === 'excess' ||
136
+ params[i].seriesName === "\u7D2F\u8BA1\u8D85\u989D"
137
+ ) {
138
+ html += `<span style='color:${params[i].color}'>
139
+ ${params[i].seriesName}</span>\uFF1A${params[i].value[1]}%
140
+ `;
141
+ } else {
142
+ 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`;
143
+ }
135
144
  } else {
136
145
  if (props.chartType === "category") {
137
146
  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.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",