@easyv/charts 1.4.18 → 1.4.19
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.
|
@@ -46,10 +46,12 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
46
46
|
marginLeft = _ref$config$line$marg.marginLeft,
|
|
47
47
|
marginRight = _ref$config$line$marg.marginRight,
|
|
48
48
|
strokeDasharray = _ref$config$line.strokeDasharray,
|
|
49
|
+
yOrZ = _ref.yOrZ,
|
|
49
50
|
_ref$yAxis = _ref.yAxis,
|
|
50
51
|
yScaler = _ref$yAxis.scaler,
|
|
51
52
|
clipValue = _ref$yAxis.clipValue,
|
|
52
53
|
isClipAxis = _ref$yAxis.isClipAxis,
|
|
54
|
+
scaler = _ref.axisX.scaler,
|
|
53
55
|
data = _ref.data;
|
|
54
56
|
|
|
55
57
|
try {
|
|
@@ -62,7 +64,18 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
62
64
|
x1 = orientation == 'left' ? yScaler[1](data.value) : marginLeft, x2 = orientation == 'left' ? yScaler[1](data.value) : width - marginRight, y1 = orientation == 'left' ? marginLeft : yScaler[1](data.value), y2 = orientation == 'left' ? height - marginRight : yScaler[1](data.value);
|
|
63
65
|
}
|
|
64
66
|
} else {
|
|
65
|
-
|
|
67
|
+
if (yOrZ == "x") {
|
|
68
|
+
x1 = orientation == 'left' ? marginLeft : scaler(data.value), x2 = orientation == 'left' ? width - marginRight : scaler(data.value), y1 = orientation == 'left' ? scaler(data.value) : marginLeft, y2 = orientation == 'left' ? scaler(data.value) : height - marginRight;
|
|
69
|
+
} else {
|
|
70
|
+
x1 = orientation == 'left' ? yScaler(data.value) : marginLeft, x2 = orientation == 'left' ? yScaler(data.value) : width - marginRight, y1 = orientation == 'left' ? marginLeft : yScaler(data.value), y2 = orientation == 'left' ? height - marginRight : yScaler(data.value);
|
|
71
|
+
}
|
|
72
|
+
} //当坐标值存在undefined时,返回null
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if ([x1, x2, y1, y2].some(function (d) {
|
|
76
|
+
return d == undefined;
|
|
77
|
+
})) {
|
|
78
|
+
return null;
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("g", {
|
|
@@ -225,7 +225,9 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
225
225
|
key: index,
|
|
226
226
|
config: baseLineConfig[index],
|
|
227
227
|
baseLineOri: baseLineOri,
|
|
228
|
+
yOrZ: yOrZ,
|
|
228
229
|
yAxis: yAxis,
|
|
230
|
+
axisX: axisX,
|
|
229
231
|
data: item
|
|
230
232
|
});
|
|
231
233
|
})), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
package/package.json
CHANGED
|
@@ -34,11 +34,12 @@ export default memo(
|
|
|
34
34
|
strokeDasharray,
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
yOrZ,
|
|
38
|
+
yAxis: { scaler: yScaler, clipValue, isClipAxis },
|
|
39
|
+
axisX: { scaler },
|
|
38
40
|
data
|
|
39
41
|
}) => {
|
|
40
42
|
try{
|
|
41
|
-
|
|
42
43
|
let x1,x2,y1,y2
|
|
43
44
|
if (isClipAxis) {
|
|
44
45
|
if (data.value > +clipValue) {
|
|
@@ -53,12 +54,22 @@ export default memo(
|
|
|
53
54
|
y2 = orientation == 'left' ? height - marginRight : yScaler[1](data.value);
|
|
54
55
|
}
|
|
55
56
|
} else {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
if(yOrZ=="x"){
|
|
58
|
+
x1 = orientation == 'left' ? marginLeft:scaler(data.value),
|
|
59
|
+
x2 = orientation == 'left' ? width - marginRight:scaler(data.value),
|
|
60
|
+
y1 = orientation == 'left' ? scaler(data.value):marginLeft ,
|
|
61
|
+
y2 = orientation == 'left' ? scaler(data.value):height - marginRight;
|
|
62
|
+
}else{
|
|
63
|
+
x1 = orientation == 'left' ? yScaler(data.value) : marginLeft,
|
|
64
|
+
x2 = orientation == 'left' ? yScaler(data.value) : width - marginRight,
|
|
65
|
+
y1 = orientation == 'left' ? marginLeft : yScaler(data.value),
|
|
66
|
+
y2 = orientation == 'left' ? height - marginRight : yScaler(data.value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//当坐标值存在undefined时,返回null
|
|
70
|
+
if([x1,x2,y1,y2].some(d=>d==undefined)){
|
|
71
|
+
return null
|
|
60
72
|
}
|
|
61
|
-
|
|
62
73
|
return (
|
|
63
74
|
<>
|
|
64
75
|
<g className='__easyv-baseLine' >
|