hfn-components 0.2.1 → 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,9 +34,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
() => props.lineColor,
|
|
35
35
|
() => {
|
|
36
36
|
echartOptions.color = props.lineColor;
|
|
37
|
-
|
|
37
|
+
if (myChart.value) {
|
|
38
|
+
echartInit();
|
|
39
|
+
}
|
|
38
40
|
},
|
|
39
|
-
{ deep: true }
|
|
41
|
+
{ deep: true, immediate: true }
|
|
40
42
|
);
|
|
41
43
|
const drawGraph = () => {
|
|
42
44
|
echartOptions.color = props.lineColor;
|
|
@@ -62,7 +64,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
64
|
setTimeout(() => {
|
|
63
65
|
if (!myChart.value) {
|
|
64
66
|
const ele = document.getElementById(props.chartId);
|
|
65
|
-
myChart.value = echarts.init(ele, null, { devicePixelRatio: 2 });
|
|
67
|
+
myChart.value = echarts.init(ele, null, { devicePixelRatio: 2, locale: "ZH" });
|
|
66
68
|
}
|
|
67
69
|
myChart.value.setOption(echartOptions, true);
|
|
68
70
|
}, 200);
|
package/es/utils/chart.mjs
CHANGED
|
@@ -131,7 +131,16 @@ const setEchartTooltip = (options, props) => {
|
|
|
131
131
|
">
|
|
132
132
|
</span>`;
|
|
133
133
|
if (props.isReturn) {
|
|
134
|
-
|
|
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}'>
|