@easyv/charts 1.9.11 → 1.9.12

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.
@@ -195,8 +195,8 @@ var Label = function Label(_ref5) {
195
195
  var y = (isVertical ? coordinate : tickSize * directionY) + translateY * directionY;
196
196
  var _style = style && ((0, _typeof2["default"])(style) == "object" ? style : style(_label));
197
197
  return /*#__PURE__*/_react["default"].createElement("foreignObject", {
198
- width: "1",
199
- height: "1"
198
+ width: "100%",
199
+ height: "100%"
200
200
  // x={x}
201
201
  // y={y}
202
202
  ,
@@ -212,11 +212,10 @@ var Label = function Label(_ref5) {
212
212
  x: label
213
213
  }),
214
214
  style: _objectSpread(_objectSpread(_objectSpread({}, _style), (0, _utils.getFontStyle)(font)), {}, {
215
- /** Safari Bug **/
216
- position: "absolute",
215
+ position: "relative",
216
+ // 替换 absolute
217
217
  cursor: "pointer",
218
- left: x + (isIOS ? iosX : 0),
219
- top: y + (isIOS ? iosY : 0)
218
+ transform: "translate(".concat(x + (isIOS ? iosX : 0), "px, ").concat(y + (isIOS ? iosY : 0), "px)") // 用 transform 定位
220
219
  })
221
220
  }, /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
222
221
  ShowType: "normal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.9.11",
3
+ "version": "1.9.12",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -229,8 +229,8 @@ const Label: (
229
229
 
230
230
  return (
231
231
  <foreignObject
232
- width="1"
233
- height="1"
232
+ width="100%"
233
+ height="100%"
234
234
  // x={x}
235
235
  // y={y}
236
236
  style={{ overflow: "visible" }}
@@ -242,11 +242,11 @@ const Label: (
242
242
  style={{
243
243
  ..._style,
244
244
  ...getFontStyle(font),
245
- /** Safari Bug **/
246
- position: "absolute",
245
+ position: "relative", // 替换 absolute
247
246
  cursor: "pointer",
248
- left: x + (isIOS ? iosX : 0),
249
- top: y + (isIOS ? iosY : 0),
247
+ transform: `translate(${x + (isIOS ? iosX : 0)}px, ${
248
+ y + (isIOS ? iosY : 0)
249
+ }px)`, // 用 transform 定位
250
250
  }}
251
251
  >
252
252
  <TextOverflow