@easyv/charts 1.8.18 → 1.8.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.
@@ -936,6 +936,7 @@ var Label = function Label(_ref10) {
936
936
  lineColor = _ref10$config.lineColor,
937
937
  distance = _ref10$config.distance,
938
938
  mode = _ref10$config.mode,
939
+ align = _ref10$config.align,
939
940
  show = _ref10$config.show,
940
941
  _ref10$config$transla = _ref10$config.translate,
941
942
  translateX = _ref10$config$transla.x,
@@ -946,6 +947,7 @@ var Label = function Label(_ref10) {
946
947
  maxWidth = _ref10$config$name.maxWidth,
947
948
  textOverflow = _ref10$config$name.textOverflow,
948
949
  speed = _ref10$config$name.speed,
950
+ NameTranslate = _ref10$config$name.translate,
949
951
  _ref10$config$value = _ref10$config.value,
950
952
  showValue = _ref10$config$value.show,
951
953
  valueFont = _ref10$config$value.font,
@@ -957,11 +959,13 @@ var Label = function Label(_ref10) {
957
959
  _ref10$config$value$s2 = _ref10$config$value$s.translate,
958
960
  suffixTranslateX = _ref10$config$value$s2.x,
959
961
  suffixTranslateY = _ref10$config$value$s2.y,
962
+ ValueTranslate = _ref10$config$value.translate,
960
963
  _ref10$config$percent = _ref10$config.percent,
961
964
  showPercent = _ref10$config$percent.show,
962
965
  percentSameColor = _ref10$config$percent.sameColor,
963
966
  percentFont = _ref10$config$percent.font,
964
967
  precision = _ref10$config$percent.precision,
968
+ PercentTranslate = _ref10$config$percent.translate,
965
969
  _ref10$iosStyle = _ref10.iosStyle,
966
970
  isIOS = _ref10$iosStyle.isIOS,
967
971
  left = _ref10$iosStyle.left,
@@ -1039,7 +1043,7 @@ var Label = function Label(_ref10) {
1039
1043
  width: "max-content",
1040
1044
  display: "flex",
1041
1045
  flexDirection: mode == "horizontal" ? "row" : "column",
1042
- alignItems: "center",
1046
+ alignItems: align == "left" ? "flex-start" : align == "center" ? "center" : "flex-end",
1043
1047
  justifyContent: "center"
1044
1048
  }
1045
1049
  }, _showName && /*#__PURE__*/_react["default"].createElement(_.TextOverflow, {
@@ -1049,11 +1053,13 @@ var Label = function Label(_ref10) {
1049
1053
  style: _objectSpread(_objectSpread({
1050
1054
  maxWidth: maxWidth
1051
1055
  }, nameStyle), {}, {
1052
- "float": mode == "horizontal" ? "left" : "none"
1056
+ "float": mode == "horizontal" ? "left" : "none",
1057
+ transform: "translate(".concat(NameTranslate.x, "px, ").concat(NameTranslate.y, "px)")
1053
1058
  })
1054
1059
  }), showValue && /*#__PURE__*/_react["default"].createElement("span", {
1055
1060
  style: _objectSpread(_objectSpread({}, (0, _utils.getFontStyle)(valueFont)), {}, {
1056
- color: valueSameColor ? pure : valueFont.color
1061
+ color: valueSameColor ? pure : valueFont.color,
1062
+ transform: "translate(".concat(ValueTranslate.x, "px, ").concat(ValueTranslate.y, "px)")
1057
1063
  })
1058
1064
  }, data.y, showSuffix && /*#__PURE__*/_react["default"].createElement("span", {
1059
1065
  style: {
@@ -1064,7 +1070,8 @@ var Label = function Label(_ref10) {
1064
1070
  }
1065
1071
  }, text)), showPercent && /*#__PURE__*/_react["default"].createElement("span", {
1066
1072
  style: _objectSpread(_objectSpread({}, (0, _utils.getFontStyle)(percentFont)), {}, {
1067
- color: percentSameColor ? pure : percentFont.color
1073
+ color: percentSameColor ? pure : percentFont.color,
1074
+ transform: "translate(".concat(PercentTranslate.x, "px, ").concat(PercentTranslate.y, "px)")
1068
1075
  })
1069
1076
  }, (_showValue ? "(" : "") + percent + "%" + (_showValue ? ")" : "")))));
1070
1077
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.8.18",
3
+ "version": "1.8.19",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1103,9 +1103,10 @@ const Label = ({
1103
1103
  lineColor,
1104
1104
  distance,
1105
1105
  mode,
1106
+ align,
1106
1107
  show,
1107
1108
  translate: { x: translateX, y: translateY },
1108
- name: { show: showName, font: nameFont, maxWidth, textOverflow, speed },
1109
+ name: { show: showName, font: nameFont, maxWidth, textOverflow, speed,translate:NameTranslate },
1109
1110
  value: {
1110
1111
  show: showValue,
1111
1112
  font: valueFont,
@@ -1116,12 +1117,14 @@ const Label = ({
1116
1117
  fontSize: suffixFontSize,
1117
1118
  translate: { x: suffixTranslateX, y: suffixTranslateY },
1118
1119
  },
1120
+ translate:ValueTranslate
1119
1121
  },
1120
1122
  percent: {
1121
1123
  show: showPercent,
1122
1124
  sameColor: percentSameColor,
1123
1125
  font: percentFont,
1124
1126
  precision,
1127
+ translate:PercentTranslate
1125
1128
  },
1126
1129
  },
1127
1130
  iosStyle: { isIOS, left, top },
@@ -1237,7 +1240,7 @@ const Label = ({
1237
1240
  width: "max-content",
1238
1241
  display: "flex",
1239
1242
  flexDirection: mode == "horizontal" ? "row" : "column",
1240
- alignItems: "center",
1243
+ alignItems: align=="left"?"flex-start":align=="center"?"center":"flex-end",
1241
1244
  justifyContent: "center",
1242
1245
  }}
1243
1246
  >
@@ -1252,6 +1255,7 @@ const Label = ({
1252
1255
  maxWidth,
1253
1256
  ...nameStyle,
1254
1257
  float: mode == "horizontal" ? "left" : "none",
1258
+ transform: `translate(${NameTranslate.x}px, ${NameTranslate.y}px)`
1255
1259
  }}
1256
1260
  ></TextOverflow>
1257
1261
  )}
@@ -1260,6 +1264,7 @@ const Label = ({
1260
1264
  style={{
1261
1265
  ...getFontStyle(valueFont),
1262
1266
  color: valueSameColor ? pure : valueFont.color,
1267
+ transform: `translate(${ValueTranslate.x}px, ${ValueTranslate.y}px)`
1263
1268
  }}
1264
1269
  >
1265
1270
  {data.y}
@@ -1282,6 +1287,7 @@ const Label = ({
1282
1287
  style={{
1283
1288
  ...getFontStyle(percentFont),
1284
1289
  color: percentSameColor ? pure : percentFont.color,
1290
+ transform: `translate(${PercentTranslate.x}px, ${PercentTranslate.y}px)`,
1285
1291
  }}
1286
1292
  >
1287
1293
  {(_showValue ? "(" : "") +