@easyv/charts 1.8.19 → 1.8.21

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.
@@ -53,9 +53,10 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
53
53
  _ref$config$showType = _ref$config.showType,
54
54
  seriesType = _ref$config$showType === void 0 ? 'bar' : _ref$config$showType,
55
55
  _ref$config$highlight = _ref$config.highlight,
56
- showHighlight = _ref$config$highlight.show,
57
- extent = _ref$config$highlight.extent,
58
- highlightStyle = (0, _objectWithoutProperties2["default"])(_ref$config$highlight, _excluded),
56
+ _ref$config$highlight2 = _ref$config$highlight === void 0 ? {} : _ref$config$highlight,
57
+ showHighlight = _ref$config$highlight2.show,
58
+ extent = _ref$config$highlight2.extent,
59
+ highlightStyle = (0, _objectWithoutProperties2["default"])(_ref$config$highlight2, _excluded),
59
60
  other = (0, _objectWithoutProperties2["default"])(_ref$config, _excluded2),
60
61
  config = _ref.config,
61
62
  curXLabel = _ref.curXLabel,
@@ -66,7 +66,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
66
66
  }
67
67
  return (0, _utils.getTranslate3d)(translate3d);
68
68
  }, [width, height, marginLeft, marginTop, position, tipWidth, tipHeight, translateTip]);
69
- return /*#__PURE__*/React.createElement("div", {
69
+ return manual ? /*#__PURE__*/React.createElement("div", {
70
70
  className: "__easyv-tooltip",
71
71
  style: _objectSpread({
72
72
  pointerEvents: 'none',
@@ -154,5 +154,5 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
154
154
  transform: (0, _utils.getTranslate3d)(suffixTranslate)
155
155
  })
156
156
  }, tmp.get(s))));
157
- }))));
157
+ })))) : "";
158
158
  });
@@ -294,7 +294,8 @@ var getFontStyle = exports.getFontStyle = function getFontStyle(_ref7, type) {
294
294
  italic = _ref7.italic,
295
295
  fontSize = _ref7.fontSize,
296
296
  fontFamily = _ref7.fontFamily,
297
- letterSpacing = _ref7.letterSpacing;
297
+ letterSpacing = _ref7.letterSpacing,
298
+ lineHeight = _ref7.lineHeight;
298
299
  if (type == 'svg') {
299
300
  return {
300
301
  fontSize: fontSize,
@@ -302,7 +303,8 @@ var getFontStyle = exports.getFontStyle = function getFontStyle(_ref7, type) {
302
303
  letterSpacing: letterSpacing,
303
304
  fill: color,
304
305
  fontWeight: bold ? 'bold' : 'normal',
305
- fontStyle: italic ? 'italic' : 'normal'
306
+ fontStyle: italic ? 'italic' : 'normal',
307
+ lineHeight: lineHeight + "px"
306
308
  };
307
309
  }
308
310
  return {
@@ -311,7 +313,8 @@ var getFontStyle = exports.getFontStyle = function getFontStyle(_ref7, type) {
311
313
  letterSpacing: letterSpacing,
312
314
  color: color,
313
315
  fontWeight: bold ? 'bold' : 'normal',
314
- fontStyle: italic ? 'italic' : 'normal'
316
+ fontStyle: italic ? 'italic' : 'normal',
317
+ lineHeight: lineHeight + "px" //不加px默认是倍数关系
315
318
  };
316
319
  };
317
320
  var formatFont = exports.formatFont = function formatFont(_ref8, type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.8.19",
3
+ "version": "1.8.21",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ export default memo(
32
32
  seriesIntervalWidth: paddingInner = 0,
33
33
  paddingInner: paddingOuter = 0,
34
34
  showType:seriesType = 'bar',
35
- highlight: { show: showHighlight, extent, ...highlightStyle },
35
+ highlight: { show: showHighlight, extent, ...highlightStyle }={},//配置项不存在的处理
36
36
  ...other
37
37
  },
38
38
  config,
@@ -64,7 +64,7 @@ export default memo(
64
64
  translateTip,
65
65
  ]);
66
66
  return (
67
- <div
67
+ manual?<div
68
68
  className='__easyv-tooltip'
69
69
  style={{
70
70
  pointerEvents: 'none',
@@ -175,7 +175,7 @@ export default memo(
175
175
 
176
176
  </div>
177
177
  )}
178
- </div>
178
+ </div>:""
179
179
  );
180
180
  }
181
181
  );
@@ -53,6 +53,7 @@ type Font = {
53
53
  fontSize: number;
54
54
  italic: boolean;
55
55
  letterSpacing: number;
56
+ lineHeight:number
56
57
  };
57
58
 
58
59
  type Align = { textAnchor: string; dominantBaseline: string };
@@ -265,7 +265,7 @@ const getMousePos = (evt, dom) => {
265
265
  };
266
266
 
267
267
  const getFontStyle = (
268
- { color, bold, italic, fontSize, fontFamily, letterSpacing },
268
+ { color, bold, italic, fontSize, fontFamily, letterSpacing,lineHeight },
269
269
  type
270
270
  ) => {
271
271
  if (type == 'svg') {
@@ -276,6 +276,7 @@ const getFontStyle = (
276
276
  fill: color,
277
277
  fontWeight: bold ? 'bold' : 'normal',
278
278
  fontStyle: italic ? 'italic' : 'normal',
279
+ lineHeight:lineHeight+"px"
279
280
  };
280
281
  }
281
282
  return {
@@ -285,6 +286,7 @@ const getFontStyle = (
285
286
  color,
286
287
  fontWeight: bold ? 'bold' : 'normal',
287
288
  fontStyle: italic ? 'italic' : 'normal',
289
+ lineHeight:lineHeight+"px"//不加px默认是倍数关系
288
290
  };
289
291
  };
290
292
  const formatFont=({ color, fill, bold, italic, ...rest },