@easyv/charts 1.5.23 → 1.5.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.
@@ -275,6 +275,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
275
275
  controlEl.current.style.transform = "translate(".concat(cBarX, "px,0)"); //计算出当前位移的百分比
276
276
 
277
277
  var percent = cBarX / (cWidth - cBarWidth);
278
+ percent = isNaN(percent) ? 1 : percent;
278
279
  var translateX = -(controlEnd + start / cPercent - chartWidth) * percent;
279
280
  curControlPercent.current = percent;
280
281
  seriesEl.current.style.transform = "translate(".concat(translateX, "px,").concat(marginTop, "px)");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.5.23",
3
+ "version": "1.5.24",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -236,7 +236,8 @@ const Chart = memo(
236
236
  if(controlEl.current){
237
237
  controlEl.current.style.transform = `translate(${cBarX}px,0)`;
238
238
  //计算出当前位移的百分比
239
- const percent = cBarX / (cWidth - cBarWidth);
239
+ let percent = cBarX / (cWidth - cBarWidth);
240
+ percent = isNaN(percent)?1:percent;
240
241
  const translateX = -(controlEnd + start/cPercent - chartWidth) * percent;
241
242
  curControlPercent.current = percent;
242
243
  seriesEl.current.style.transform = `translate(${translateX}px,${marginTop}px)`;
@@ -539,7 +540,6 @@ const Chart = memo(
539
540
  height={height}
540
541
  />
541
542
  )}
542
-
543
543
  {showCtl && !!control && (
544
544
  <Tooltip
545
545
  isVertical={isVertical}
@@ -95,6 +95,7 @@ export default ({
95
95
  };
96
96
  }, [auto, tickLength, interval, isHover, active]);
97
97
  const name = currentIndex === null ? null : axisX.allTicks[currentIndex];
98
+
98
99
  return {
99
100
  name,
100
101
  x: axisX.scaler(name),