@easyv/charts 1.5.18 → 1.5.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.
@@ -350,6 +350,7 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
350
350
 
351
351
  var _useContext = (0, _react.useContext)(_context.chartContext),
352
352
  id = _useContext.id,
353
+ isIOS = _useContext.isIOS,
353
354
  chartWidth = _useContext.width,
354
355
  chartHeight = _useContext.height,
355
356
  triggerOnRelative = _useContext.triggerOnRelative,
@@ -796,8 +797,13 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
796
797
  }
797
798
  }, /*#__PURE__*/_react["default"].createElement(Current, {
798
799
  config: current,
799
- width: width,
800
- height: height,
800
+ width: chartWidth,
801
+ height: chartHeight,
802
+ iosStyle: {
803
+ marginLeft: marginLeft,
804
+ marginTop: marginTop,
805
+ isIOS: isIOS
806
+ },
801
807
  data: _arcs,
802
808
  judge: judgeData,
803
809
  currentIndex: +currentIndex
@@ -867,6 +873,10 @@ var Current = function Current(_ref9) {
867
873
  _ref9$config$value$su2 = _ref9$config$value$su.translate,
868
874
  translateSuffixX = _ref9$config$value$su2.x,
869
875
  translateSuffixY = _ref9$config$value$su2.y,
876
+ _ref9$iosStyle = _ref9.iosStyle,
877
+ isIOS = _ref9$iosStyle.isIOS,
878
+ marginLeft = _ref9$iosStyle.marginLeft,
879
+ marginTop = _ref9$iosStyle.marginTop,
870
880
  width = _ref9.width,
871
881
  height = _ref9.height,
872
882
  data = _ref9.data,
@@ -897,17 +907,20 @@ var Current = function Current(_ref9) {
897
907
  //foreignObject标签样式,
898
908
  width: width,
899
909
  height: height,
900
- transform: "translate(-".concat(width / 2, "px,-").concat(height / 2, "px)"),
910
+ position: "relative",
911
+ overflow: "visible",
901
912
  pointerEvents: "none"
902
913
  },
903
914
  boxStyle = {
904
915
  //弹性盒子样式,用于当前值的上下居中对齐等
905
916
  width: width,
906
917
  height: height,
918
+ position: "absolute",
907
919
  display: "flex",
908
920
  flexDirection: "column",
909
921
  justifyContent: "center",
910
- alignItems: "center"
922
+ alignItems: "center",
923
+ transform: isIOS ? "translate(".concat(marginLeft, "px,").concat(marginTop, "px)") : "translate(-".concat(width / 2, "px,-").concat(height / 2, "px)")
911
924
  };
912
925
  var seriesColor = currentData.series.color;
913
926
  seriesColor = seriesColor.type == "pure" ? seriesColor.pure : seriesColor.linear.stops[0].color;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.5.18",
3
+ "version": "1.5.19",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -295,6 +295,7 @@ const Component = memo(
295
295
  const { precision: legendPrecision } = legend.config.percent;
296
296
  const {
297
297
  id,
298
+ isIOS,
298
299
  width: chartWidth,
299
300
  height: chartHeight,
300
301
  triggerOnRelative,
@@ -826,8 +827,11 @@ const Component = memo(
826
827
  >
827
828
  <Current
828
829
  config={current}
829
- width={width}
830
- height={height}
830
+ width={chartWidth}
831
+ height={chartHeight}
832
+ iosStyle={{
833
+ marginLeft, marginTop, isIOS
834
+ }}
831
835
  data={_arcs}
832
836
  judge={judgeData}
833
837
  currentIndex={+currentIndex}
@@ -910,6 +914,9 @@ const Current = ({
910
914
  },
911
915
  },
912
916
  },
917
+ iosStyle:{
918
+ isIOS, marginLeft, marginTop
919
+ },
913
920
  width,
914
921
  height,
915
922
  data,
@@ -939,17 +946,20 @@ const Current = ({
939
946
  //foreignObject标签样式,
940
947
  width,
941
948
  height,
942
- transform: `translate(-${width / 2}px,-${height / 2}px)`,
949
+ position:"relative",
950
+ overflow:"visible",
943
951
  pointerEvents: "none",
944
952
  },
945
953
  boxStyle = {
946
954
  //弹性盒子样式,用于当前值的上下居中对齐等
947
955
  width,
948
956
  height,
957
+ position:"absolute",
949
958
  display: "flex",
950
959
  flexDirection: "column",
951
960
  justifyContent: "center",
952
961
  alignItems: "center",
962
+ transform: isIOS?`translate(${marginLeft}px,${marginTop}px)`:`translate(-${width / 2}px,-${height / 2}px)`,
953
963
  };
954
964
  let seriesColor = currentData.series.color;
955
965
  seriesColor =