@easyv/charts 1.6.5 → 1.6.7

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.
@@ -38,10 +38,11 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
38
38
  lineHeight = _ref$config$tip$data$2.lineHeight,
39
39
  dataGap = _ref$config$tip$data$2.gap,
40
40
  iconSize = _ref$config$tip$data$2.iconSize,
41
- dataBackground = _ref$config$tip$data$2.background,
41
+ dataBg = _ref$config$tip$data$2.background,
42
42
  name = _ref$config$tip$data$2.name,
43
43
  value = _ref$config$tip$data$2.value,
44
44
  suffix = _ref$config$tip$data$2.suffix,
45
+ bgType = _ref$config$tip.bgType,
45
46
  bgColor = _ref$config$tip.bgColor,
46
47
  image = _ref$config$tip.image,
47
48
  margin = _ref$config$tip.margin,
@@ -61,12 +62,12 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
61
62
  });
62
63
 
63
64
  if (translate3d.x + tipWidth > width) {
64
- var newPositon = position + marginLeft - tipWidth - translateTip.x;
65
+ var newPositon = position + marginLeft - tipWidth + translateTip.x;
65
66
  translate3d.x = newPositon >= 0 ? newPositon : 0;
66
67
  }
67
68
 
68
69
  if (translate3d.y + tipHeight > height) {
69
- var _newPositon = position + marginTop - tipHeight - translateTip.y;
70
+ var _newPositon = position + marginTop - tipHeight + translateTip.y;
70
71
 
71
72
  translate3d.y = _newPositon <= 0 ? _newPositon : height - tipHeight;
72
73
  }
@@ -81,7 +82,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
81
82
  width: tipWidth,
82
83
  minHeight: tipHeight,
83
84
  padding: (0, _utils.getMargin)(margin),
84
- background: image ? '50% 50% / 100% 100% no-repeat url(' + window.appConfig.ASSETS_URL + image + ')' : bgColor
85
+ background: bgType == "image" ? image ? '50% 50% / 100% 100% no-repeat url(' + window.appConfig.ASSETS_URL + image + ')' : "transparent" : bgColor
85
86
  }, (0, _utils.getFontStyle)(font))
86
87
  }, formatter ? formatter({
87
88
  series: series,
@@ -93,19 +94,28 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
93
94
  data: data,
94
95
  config: dataConfig
95
96
  }
96
- }) : /*#__PURE__*/React.createElement("dl", {
97
+ }) : /*#__PURE__*/React.createElement("div", {
97
98
  style: {
98
99
  display: 'flex',
99
100
  flexDirection: 'column',
100
101
  justifyContent: 'space-between',
102
+ gap: gap,
101
103
  height: '100%'
102
104
  }
103
- }, /*#__PURE__*/React.createElement("dt", {
105
+ }, /*#__PURE__*/React.createElement("div", {
104
106
  style: _objectSpread({
105
107
  textAlign: align,
106
- transform: (0, _utils.getTranslate3d)(translateXAxis)
108
+ transform: (0, _utils.getTranslate3d)(translateXAxis),
109
+ background: background ? "url(".concat(window.appConfig.ASSETS_URL + background, ") 0 0/100% 100%") : "transparent"
107
110
  }, font)
108
- }, x), data.map(function (_ref2, index) {
111
+ }, x), /*#__PURE__*/React.createElement("div", {
112
+ style: {
113
+ display: "flex",
114
+ flexFlow: "column nowrap",
115
+ gap: dataGap,
116
+ background: dataBg ? "url(".concat(window.appConfig.ASSETS_URL + dataBg, ") 0 0/100% 100%") : "transparent"
117
+ }
118
+ }, data.map(function (_ref2, index) {
109
119
  var showY = _ref2.showY,
110
120
  s = _ref2.s;
111
121
 
@@ -156,7 +166,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
156
166
  transform: (0, _utils.getTranslate3d)(suffixTranslate)
157
167
  })
158
168
  }, tmp.get(s))));
159
- })));
169
+ }))));
160
170
  });
161
171
 
162
172
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@ export default memo(
20
20
  data: dataConfig,
21
21
  data: { lineHeight, gap:dataGap, iconSize, background:dataBg, name, value, suffix },
22
22
  },
23
+ bgType,
23
24
  bgColor,
24
25
  image,
25
26
  margin,
@@ -43,11 +44,11 @@ export default memo(
43
44
  x: translateTip.x + position + marginLeft,
44
45
  };
45
46
  if (translate3d.x + tipWidth > width) {
46
- const newPositon = position + marginLeft - tipWidth - translateTip.x;
47
+ const newPositon = position + marginLeft - tipWidth + translateTip.x;
47
48
  translate3d.x = newPositon >= 0 ? newPositon : 0;
48
49
  }
49
50
  if (translate3d.y + tipHeight > height) {
50
- const newPositon = position + marginTop - tipHeight - translateTip.y;
51
+ const newPositon = position + marginTop - tipHeight + translateTip.y;
51
52
  translate3d.y = newPositon <= 0 ? newPositon : height - tipHeight;
52
53
  }
53
54
  return getTranslate3d(translate3d);
@@ -70,12 +71,12 @@ export default memo(
70
71
  width: tipWidth,
71
72
  minHeight: tipHeight,
72
73
  padding: getMargin(margin),
73
- background: image
74
+ background: bgType=="image"?image
74
75
  ? '50% 50% / 100% 100% no-repeat url(' +
75
76
  window.appConfig.ASSETS_URL +
76
77
  image +
77
78
  ')'
78
- : bgColor,
79
+ : "transparent":bgColor,
79
80
  ...getFontStyle(font),
80
81
  }}
81
82
  >