@easyv/charts 1.3.23 → 1.3.24
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.
- package/lib/components/BaseLine.js +35 -31
- package/package.json +1 -1
- package/src/components/BaseLine.js +41 -38
|
@@ -48,37 +48,41 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
48
48
|
strokeDasharray = _ref$config$line.strokeDasharray,
|
|
49
49
|
yScaler = _ref.yAxis.scaler,
|
|
50
50
|
data = _ref.data;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
var x1 = orientation == 'left' ? yScaler(data.value) : marginLeft,
|
|
54
|
+
x2 = orientation == 'left' ? yScaler(data.value) : width - marginRight,
|
|
55
|
+
y1 = orientation == 'left' ? marginLeft : yScaler(data.value),
|
|
56
|
+
y2 = orientation == 'left' ? height - marginRight : yScaler(data.value);
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("g", {
|
|
58
|
+
className: "__easyv-baseLine"
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement("line", {
|
|
60
|
+
x1: x1,
|
|
61
|
+
x2: x2,
|
|
62
|
+
y1: y1,
|
|
63
|
+
y2: y2,
|
|
64
|
+
stroke: color,
|
|
65
|
+
fill: "none",
|
|
66
|
+
strokeDasharray: lineType === 'dash' ? strokeDasharray : null,
|
|
67
|
+
strokeWidth: lineWidth
|
|
68
|
+
})), labelShow && /*#__PURE__*/_react["default"].createElement("foreignObject", {
|
|
69
|
+
width: 100,
|
|
70
|
+
height: 100,
|
|
71
|
+
x: x2 + labelTranslate.x,
|
|
72
|
+
y: y2 - textStyle.fontSize + labelTranslate.y
|
|
73
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
74
|
+
style: _objectSpread({}, (0, _utils.getFontStyle)(textStyle))
|
|
75
|
+
}, label))), dataShow && /*#__PURE__*/_react["default"].createElement("foreignObject", {
|
|
76
|
+
width: 100,
|
|
77
|
+
height: 100,
|
|
78
|
+
x: x2 + dataTranslate.x,
|
|
79
|
+
y: y2 + dataTranslate.y
|
|
80
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
81
|
+
style: _objectSpread({}, (0, _utils.getFontStyle)(dataStyle))
|
|
82
|
+
}, data.value))));
|
|
83
|
+
} catch (e) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
82
86
|
});
|
|
83
87
|
|
|
84
88
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -37,46 +37,49 @@ export default memo(
|
|
|
37
37
|
yAxis: { scaler: yScaler },
|
|
38
38
|
data
|
|
39
39
|
}) => {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
try{
|
|
41
|
+
const x1 = orientation == 'left' ? yScaler(data.value) : marginLeft,
|
|
42
42
|
x2 = orientation == 'left' ? yScaler(data.value) : width - marginRight,
|
|
43
43
|
y1 = orientation == 'left' ? marginLeft : yScaler(data.value),
|
|
44
44
|
y2 = orientation == 'left' ? height - marginRight : yScaler(data.value);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<g className='__easyv-baseLine' >
|
|
48
|
+
<line
|
|
49
|
+
x1={x1}
|
|
50
|
+
x2={x2}
|
|
51
|
+
y1={y1}
|
|
52
|
+
y2={y2}
|
|
53
|
+
stroke={color}
|
|
54
|
+
fill='none'
|
|
55
|
+
strokeDasharray={lineType === 'dash' ? strokeDasharray : null}
|
|
56
|
+
strokeWidth={lineWidth}
|
|
57
|
+
/>
|
|
58
|
+
</g>
|
|
59
|
+
{labelShow &&
|
|
60
|
+
<foreignObject
|
|
61
|
+
width={100}
|
|
62
|
+
height={100}
|
|
63
|
+
x={x2 + labelTranslate.x}
|
|
64
|
+
y={y2 - textStyle.fontSize + labelTranslate.y}>
|
|
65
|
+
<div>
|
|
66
|
+
<span style={{ ...getFontStyle(textStyle) }}>{label}</span>
|
|
67
|
+
</div>
|
|
68
|
+
</foreignObject>}
|
|
69
|
+
{dataShow &&
|
|
70
|
+
<foreignObject
|
|
71
|
+
width={100}
|
|
72
|
+
height={100}
|
|
73
|
+
x={x2 + dataTranslate.x}
|
|
74
|
+
y={y2 + dataTranslate.y}>
|
|
75
|
+
<div>
|
|
76
|
+
<span style={{ ...getFontStyle(dataStyle) }}>{data.value}</span>
|
|
77
|
+
</div>
|
|
78
|
+
</foreignObject>}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}catch(e){
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
85
|
);
|