@easyv/charts 1.7.33 → 1.7.35

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.
@@ -197,7 +197,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
197
197
  borderWidth = _ref6$borderWidth === void 0 ? 0 : _ref6$borderWidth;
198
198
  var borderStr = "".concat(pure, " solid ").concat(borderWidth, "px");
199
199
  var borderImageSource = (0, _utils.getMultiColorStr)(linear);
200
- var positionX = xScaler(x) - step / 2 + seriesStart + index * seriesStep;
200
+ var positionX = _data.length == 1 ? xScaler(x) - seriesStart / 2 : xScaler(x) - step / 2 + seriesStart + index * seriesStep;
201
201
  var showHead, headType, headUrl, headVideo, headWidth, headHeight, headTranslate;
202
202
  if (headDecorate) {
203
203
  showHead = headDecorate.show, headType = headDecorate.type, headUrl = headDecorate.url, headVideo = headDecorate.video, headWidth = headDecorate.size.width, headHeight = headDecorate.size.height, headTranslate = headDecorate.translate;
@@ -55,7 +55,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
55
55
  props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
56
56
  var width = props.width,
57
57
  height = props.height;
58
- var isIOS = (0, _react.useRef)(/iPad|iPhone|iPod|iOS|CriOS/i.test(navigator.userAgent));
58
+ var isIOS = (0, _react.useRef)(/iPad|iPhone|iPod|iOS/i.test(navigator.userAgent) || /Mac OS X/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent));
59
59
  var svg = /*#__PURE__*/(0, _react.createRef)();
60
60
  var chartWidth = width - marginLeft - marginRight;
61
61
  var chartHeight = height - marginTop - marginBottom;
@@ -601,7 +601,12 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
601
601
  },
602
602
  arcs: _arcs,
603
603
  judge: judgeData
604
- }))), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
604
+ }))), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement("div", {
605
+ style: {
606
+ position: 'absolute',
607
+ zIndex: 9999
608
+ }
609
+ }, /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
605
610
  series: series,
606
611
  data: hoverData,
607
612
  config: tooltip,
@@ -610,7 +615,7 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
610
615
  y: maxRadius + marginTop
611
616
  },
612
617
  mousePos: mousePos
613
- }), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
618
+ })), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
614
619
  height: chartHeight,
615
620
  series: _arcs.map(function (arc) {
616
621
  return _objectSpread(_objectSpread({}, arc), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.7.33",
3
+ "version": "1.7.35",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -164,8 +164,8 @@ export default memo(
164
164
  }, borderWidth=0 } = border || {};
165
165
  const borderStr = `${pure} solid ${borderWidth}px`;
166
166
  const borderImageSource = getMultiColorStr(linear);
167
- const positionX = xScaler(x) - step / 2 + seriesStart + index * seriesStep;
168
-
167
+ const positionX =_data.length==1? xScaler(x) -seriesStart/2 :xScaler(x) - step / 2 + seriesStart + index * seriesStep;
168
+
169
169
  let showHead, headType, headUrl, headVideo, headWidth, headHeight, headTranslate;
170
170
  if (headDecorate) {
171
171
  (showHead = headDecorate.show),
@@ -37,7 +37,11 @@ const Chart = memo(
37
37
  ...props
38
38
  }) => {
39
39
  const { width, height } = props;
40
- const isIOS = useRef(/iPad|iPhone|iPod|iOS|CriOS/i.test(navigator.userAgent));
40
+ const isIOS = useRef(
41
+ /iPad|iPhone|iPod|iOS/i.test(navigator.userAgent) ||
42
+ (/Mac OS X/i.test(navigator.userAgent) &&
43
+ !/Chrome/i.test(navigator.userAgent))
44
+ );
41
45
  const svg = createRef();
42
46
  const chartWidth = width - marginLeft - marginRight;
43
47
  const chartHeight = height - marginTop - marginBottom;
@@ -615,6 +615,7 @@ const Component = memo(
615
615
  mousePos.x != 0 &&
616
616
  mousePos.y != 0 &&
617
617
  tooltip.manual && (
618
+ <div style={{ position: 'absolute', zIndex: 9999 }}>
618
619
  <PieTooltip
619
620
  series={series}
620
621
  data={hoverData}
@@ -625,6 +626,7 @@ const Component = memo(
625
626
  }}
626
627
  mousePos={mousePos}
627
628
  />
629
+ </div>
628
630
  )}
629
631
  <Legend
630
632
  {...legend}