@easyv/charts 1.5.19 → 1.5.20

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.
@@ -659,6 +659,11 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
659
659
  config: _objectSpread(_objectSpread({}, label), {}, {
660
660
  maxRadius: maxRadius + 2
661
661
  }),
662
+ iosStyle: {
663
+ isIOS: isIOS,
664
+ left: halfChartWidth + marginLeft,
665
+ top: halfChartHeight + marginTop
666
+ },
662
667
  arcs: _arcs,
663
668
  judge: judgeData
664
669
  }))), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
@@ -788,6 +793,11 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
788
793
  })));
789
794
  }), label && /*#__PURE__*/_react["default"].createElement(Label, {
790
795
  config: label,
796
+ iosStyle: {
797
+ isIOS: isIOS,
798
+ left: halfChartWidth + marginLeft,
799
+ top: halfChartHeight + marginTop
800
+ },
791
801
  arcs: _arcs,
792
802
  judge: judgeData
793
803
  }), current && /*#__PURE__*/_react["default"].createElement("g", {
@@ -997,6 +1007,10 @@ var Label = function Label(_ref10) {
997
1007
  showPercent = _ref10$config$percent.show,
998
1008
  percentFont = _ref10$config$percent.font,
999
1009
  precision = _ref10$config$percent.precision,
1010
+ _ref10$iosStyle = _ref10.iosStyle,
1011
+ isIOS = _ref10$iosStyle.isIOS,
1012
+ left = _ref10$iosStyle.left,
1013
+ top = _ref10$iosStyle.top,
1000
1014
  arcs = _ref10.arcs,
1001
1015
  judge = _ref10.judge,
1002
1016
  animation = _ref10.animation;
@@ -1070,15 +1084,19 @@ var Label = function Label(_ref10) {
1070
1084
  x: _x,
1071
1085
  y: y2 + translateY,
1072
1086
  style: {
1073
- overflow: "visible"
1087
+ overflow: "visible",
1088
+ position: "relative"
1074
1089
  }
1075
1090
  }, /*#__PURE__*/_react["default"].createElement("div", {
1076
1091
  className: animation ? _piechartModule["default"]["label-text"] : "",
1077
1092
  style: {
1078
- transform: "translate(0,-50%)",
1093
+ position: isIOS ? "absolute" : "relative",
1094
+ transform: isIOS ? "translate(calc(".concat(x3 < 0 ? "-100%" : "0px", " + ").concat(left + _x, "px),calc(-50% + ").concat(top + y2 + translateY, "px))") : "translate(0,-50%)",
1079
1095
  whiteSpace: "nowrap",
1080
1096
  "float": x3 >= 0 ? "left" : "right",
1081
- width: "max-content"
1097
+ width: "max-content",
1098
+ display: "flex",
1099
+ alignItems: "center"
1082
1100
  }
1083
1101
  }, _showName && /*#__PURE__*/_react["default"].createElement(_.TextOverflow, {
1084
1102
  type: textOverflow,
@@ -1136,6 +1154,10 @@ var RingLabel = function RingLabel(_ref12) {
1136
1154
  showPercent = _ref12$config$percent.show,
1137
1155
  percentFont = _ref12$config$percent.font,
1138
1156
  precision = _ref12$config$percent.precision,
1157
+ _ref12$iosStyle = _ref12.iosStyle,
1158
+ isIOS = _ref12$iosStyle.isIOS,
1159
+ left = _ref12$iosStyle.left,
1160
+ top = _ref12$iosStyle.top,
1139
1161
  judge = _ref12.judge,
1140
1162
  arcs = _ref12.arcs;
1141
1163
 
@@ -1208,16 +1230,20 @@ var RingLabel = function RingLabel(_ref12) {
1208
1230
  x: _x,
1209
1231
  y: y2 + translateY,
1210
1232
  style: {
1211
- overflow: "visible"
1233
+ overflow: "visible",
1234
+ position: "relative"
1212
1235
  }
1213
1236
  }, /*#__PURE__*/_react["default"].createElement("div", {
1214
1237
  className: _piechartModule["default"]["label-text"],
1215
1238
  style: {
1216
- transform: "translate(0,-50%)",
1239
+ position: isIOS ? "absolute" : "relative",
1240
+ transform: isIOS ? "translate(calc(".concat(x3 < 0 ? "-100%" : "0px", " + ").concat(left + _x, "px),calc(-50% + ").concat(top + y2 + translateY, "px))") : "translate(0,-50%)",
1217
1241
  whiteSpace: "nowrap",
1218
1242
  "float": x3 >= 0 ? "left" : "right",
1219
1243
  width: "max-content",
1220
- animationDelay: "".concat((actualIndex + 1) * 2000 - 800, "ms")
1244
+ animationDelay: "".concat((actualIndex + 1) * 2000 - 800, "ms"),
1245
+ display: "flex",
1246
+ alignItems: "center"
1221
1247
  }
1222
1248
  }, _showName && /*#__PURE__*/_react["default"].createElement(_.TextOverflow, {
1223
1249
  type: textOverflow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.5.19",
3
+ "version": "1.5.20",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -602,6 +602,7 @@ const Component = memo(
602
602
  {label && (
603
603
  <RingLabel
604
604
  config={{ ...label, maxRadius: maxRadius + 2 }}
605
+ iosStyle={{isIOS, left:halfChartWidth+marginLeft, top:halfChartHeight+marginTop}}
605
606
  arcs={_arcs}
606
607
  judge={judgeData}
607
608
  />
@@ -819,7 +820,7 @@ const Component = memo(
819
820
  );
820
821
  }
821
822
  )}
822
- {label && <Label config={label} arcs={_arcs} judge={judgeData} />}
823
+ {label && <Label config={label} iosStyle={{isIOS, left:halfChartWidth+marginLeft, top:halfChartHeight+marginTop}} arcs={_arcs} judge={judgeData} />}
823
824
  {current && (
824
825
  <g
825
826
  fillOpacity={y}
@@ -1070,6 +1071,9 @@ const Label = ({
1070
1071
  },
1071
1072
  percent: { show: showPercent, font: percentFont, precision },
1072
1073
  },
1074
+ iosStyle:{
1075
+ isIOS, left, top
1076
+ },
1073
1077
  arcs,
1074
1078
  judge,
1075
1079
  animation,
@@ -1125,7 +1129,6 @@ const Label = ({
1125
1129
  const _showName = showName && displayName;
1126
1130
  const _showValue = showValue && (value || showSuffix);
1127
1131
  const nameStyle = getFontStyle(nameFont);
1128
-
1129
1132
  return (
1130
1133
  show &&
1131
1134
  (_showName || showPercent || showValue) && (
@@ -1165,15 +1168,18 @@ const Label = ({
1165
1168
  height="1"
1166
1169
  x={_x}
1167
1170
  y={y2 + translateY}
1168
- style={{ overflow: "visible" }}
1171
+ style={{ overflow: "visible", position:"relative" }}
1169
1172
  >
1170
1173
  <div
1171
1174
  className={animation ? ringCss["label-text"] : ""}
1172
1175
  style={{
1173
- transform: "translate(0,-50%)",
1176
+ position:isIOS?"absolute":"relative",
1177
+ transform: isIOS?`translate(calc(${x3<0?"-100%":"0px"} + ${left+_x}px),calc(-50% + ${top+y2+translateY}px))`:"translate(0,-50%)",
1174
1178
  whiteSpace: "nowrap",
1175
1179
  float: x3 >= 0 ? "left" : "right",
1176
1180
  width: "max-content",
1181
+ display:"flex",
1182
+ alignItems:"center"
1177
1183
  }}
1178
1184
  >
1179
1185
  {_showName && (
@@ -1248,6 +1254,9 @@ const RingLabel = ({
1248
1254
  },
1249
1255
  percent: { show: showPercent, font: percentFont, precision },
1250
1256
  },
1257
+ iosStyle:{
1258
+ isIOS, left, top
1259
+ },
1251
1260
  judge,
1252
1261
  arcs,
1253
1262
  }) => {
@@ -1342,16 +1351,19 @@ const RingLabel = ({
1342
1351
  height="1"
1343
1352
  x={_x}
1344
1353
  y={y2 + translateY}
1345
- style={{ overflow: "visible" }}
1354
+ style={{ overflow: "visible", position:"relative" }}
1346
1355
  >
1347
1356
  <div
1348
1357
  className={ringCss["label-text"]}
1349
1358
  style={{
1350
- transform: "translate(0,-50%)",
1359
+ position:isIOS?"absolute":"relative",
1360
+ transform: isIOS?`translate(calc(${x3<0?"-100%":"0px"} + ${left+_x}px),calc(-50% + ${top+y2+translateY}px))`:"translate(0,-50%)",
1351
1361
  whiteSpace: "nowrap",
1352
1362
  float: x3 >= 0 ? "left" : "right",
1353
1363
  width: "max-content",
1354
1364
  animationDelay: `${(actualIndex + 1) * 2000 - 800}ms`,
1365
+ display:"flex",
1366
+ alignItems:"center"
1355
1367
  }}
1356
1368
  >
1357
1369
  {_showName && (