@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 +1 -1
- package/lib/components/Label.js +11 -1
- package/package.json +1 -1
- package/src/components/Label.js +8 -2
package/.husky/commit-msg
CHANGED
package/lib/components/Label.js
CHANGED
|
@@ -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
package/src/components/Label.js
CHANGED
|
@@ -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
|
};
|