@easyv/charts 1.4.17 → 1.4.18

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.
package/.husky/commit-msg CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
3
 
4
- pnpm commitlint --edit $1
4
+ yarn commitlint --edit $1
@@ -151,6 +151,12 @@ var Label = function Label(_ref3) {
151
151
  translateX = _ref3$config$translat2 === void 0 ? 0 : _ref3$config$translat2,
152
152
  _ref3$config$translat3 = _ref3$config$translat.y,
153
153
  translateY = _ref3$config$translat3 === void 0 ? 0 : _ref3$config$translat3,
154
+ _ref3$config$suffix = _ref3$config.suffix,
155
+ content = _ref3$config$suffix.content,
156
+ suffixFont = _ref3$config$suffix.font,
157
+ _ref3$config$suffix$t = _ref3$config$suffix.translate,
158
+ suffixX = _ref3$config$suffix$t.x,
159
+ suffixY = _ref3$config$suffix$t.y,
154
160
  _ref3$textAnchor = _ref3.textAnchor,
155
161
  textAnchor = _ref3$textAnchor === void 0 ? "middle" : _ref3$textAnchor,
156
162
  _ref3$dominantBaselin = _ref3.dominantBaseline,
@@ -164,7 +170,11 @@ var Label = function Label(_ref3) {
164
170
  }),
165
171
  textAnchor: textAnchor,
166
172
  dominantBaseline: dominantBaseline
167
- }, font), value);
173
+ }, font), /*#__PURE__*/React.createElement("tspan", null, value), /*#__PURE__*/React.createElement("tspan", {
174
+ dx: suffixX,
175
+ dy: suffixY,
176
+ style: _objectSpread({}, (0, _utils.getFontStyle)(suffixFont, "svg"))
177
+ }, content));
168
178
  };
169
179
 
170
180
  var Icon = function Icon(_ref4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -2,7 +2,7 @@
2
2
  * 轴类图表标签
3
3
  */
4
4
  import { memo, useContext } from "react";
5
- import { getTranslate2d, getSeriesInfo } from "../utils";
5
+ import { getTranslate2d, getSeriesInfo, getFontStyle } from "../utils";
6
6
  import { chartContext } from "../context";
7
7
 
8
8
  export default memo(
@@ -120,6 +120,9 @@ const Label = ({
120
120
  config: {
121
121
  font,
122
122
  translate: { x: translateX = 0, y: translateY = 0 },
123
+ suffix:{
124
+ content, font:suffixFont, translate:{ x:suffixX, y:suffixY }
125
+ }
123
126
  },
124
127
  textAnchor = "middle",
125
128
  dominantBaseline = "middle",
@@ -136,7 +139,10 @@ const Label = ({
136
139
  dominantBaseline={dominantBaseline}
137
140
  {...font}
138
141
  >
139
- {value}
142
+ <tspan>{value}</tspan>
143
+ <tspan dx={suffixX} dy={suffixY} style={{
144
+ ...getFontStyle(suffixFont,"svg")
145
+ }}>{content}</tspan>
140
146
  </text>
141
147
  );
142
148
  };