@easyv/charts 1.3.11 → 1.3.13

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.
@@ -218,7 +218,7 @@ var Label = function Label(_ref5) {
218
218
  letterSpacing: letterSpacing,
219
219
  dx: "0",
220
220
  dy: "0",
221
- transform: Array.isArray(_label) ? rotate !== 0 ? isVertical ? translateText + 'rotate(' + rotate + ')' : 'rotate(' + rotate + ', ' + x + ', ' + y + ')' : isVertical ? translateText : 'translate(' + translateX + ', ' + translateY + ')' : translateText + 'rotate(' + rotate + ')'
221
+ transform: Array.isArray(_label) ? rotate !== 0 ? isVertical ? translateText + ' rotate(' + rotate + ')' : 'rotate(' + rotate + ', ' + x + ', ' + y + ')' : isVertical ? translateText : 'translate(' + translateX + ', ' + translateY + ')' : translateText + ' rotate(' + rotate + ')'
222
222
  }, !!Array.isArray(_label) ? _label.map(function (item, index) {
223
223
  return /*#__PURE__*/_react["default"].createElement("tspan", {
224
224
  key: index,
@@ -146,7 +146,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
146
146
  var showHead, headUrl, headWidth, headHeight, headTranslate;
147
147
 
148
148
  if (headDecorate) {
149
- showHead = headDecorate.show, headUrl = headDecorate.url, headWidth = headDecorate.size.width, headHeight = headDecorate.size.height, headTranslate = headDecorate.headTranslate;
149
+ showHead = headDecorate.show, headUrl = headDecorate.url, headWidth = headDecorate.size.width, headHeight = headDecorate.size.height, headTranslate = headDecorate.translate;
150
150
  }
151
151
 
152
152
  if (isNaN(positionX)) return null;
@@ -173,9 +173,10 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
173
173
  background: "url(".concat(window.appConfig.ASSETS_URL + headUrl, ") 0 0/100% 100%"),
174
174
  width: headWidth,
175
175
  height: headHeight,
176
- left: "50%",
176
+ left: isVertical ? "100%" : "50%",
177
+ top: isVertical ? "50%" : "0",
177
178
  zIndex: 1,
178
- transform: "translate(calc(-50% + ".concat(headTranslate.x, "px), ").concat(headTranslate.y, "px)")
179
+ transform: "translate(calc(-50% + ".concat(headTranslate.x, "px), calc(-50% + ").concat(headTranslate.y, "px))")
179
180
  }
180
181
  }), /*#__PURE__*/_react["default"].createElement("div", {
181
182
  style: {
@@ -83,7 +83,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
83
83
 
84
84
  var positionX = xScaler(x) - step / 2 + seriesStart + index * seriesStep;
85
85
  if (isNaN(positionX)) return null;
86
- var position = positionX + seriesWidth / 2;
86
+ var position = positionX + (config.line ? step : seriesWidth) / 2;
87
87
  var labelPosition = isVertical ? getVerticalLabel({
88
88
  position: _position,
89
89
  y: y,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -217,12 +217,12 @@ const Label: (
217
217
  Array.isArray(_label)
218
218
  ? rotate !== 0
219
219
  ? isVertical
220
- ? translateText + 'rotate(' + rotate + ')'
220
+ ? translateText + ' rotate(' + rotate + ')'
221
221
  : 'rotate(' + rotate + ', ' + x + ', ' + y + ')'
222
222
  : isVertical
223
223
  ? translateText
224
224
  : 'translate(' + translateX + ', ' + translateY + ')'
225
- : translateText + 'rotate(' + rotate + ')'
225
+ : translateText + ' rotate(' + rotate + ')'
226
226
  }
227
227
  >
228
228
  {!!Array.isArray(_label)
@@ -122,7 +122,7 @@ export default memo(
122
122
  headUrl = headDecorate.url,
123
123
  headWidth = headDecorate.size.width,
124
124
  headHeight = headDecorate.size.height,
125
- headTranslate = headDecorate.headTranslate;
125
+ headTranslate = headDecorate.translate;
126
126
  }
127
127
 
128
128
  if (isNaN(positionX)) return null;
@@ -150,9 +150,10 @@ export default memo(
150
150
  background:`url(${window.appConfig.ASSETS_URL+headUrl}) 0 0/100% 100%`,
151
151
  width:headWidth,
152
152
  height:headHeight,
153
- left:"50%",
153
+ left:isVertical?"100%":"50%",
154
+ top:isVertical?"50%":"0",
154
155
  zIndex:1,
155
- transform:`translate(calc(-50% + ${headTranslate.x}px), ${headTranslate.y}px)`
156
+ transform:`translate(calc(-50% + ${headTranslate.x}px), calc(-50% + ${headTranslate.y}px))`
156
157
  }}></div>}
157
158
  <div
158
159
  style={{
@@ -33,7 +33,6 @@ export default memo(
33
33
  paddingInner,
34
34
  paddingOuter,
35
35
  });
36
-
37
36
  const isVertical = direction === 'vertical';
38
37
  const _position = label.position;
39
38
  return (
@@ -57,7 +56,7 @@ export default memo(
57
56
  xScaler(x) - step / 2 + seriesStart + index * seriesStep;
58
57
 
59
58
  if (isNaN(positionX)) return null;
60
- const position = positionX + seriesWidth / 2;
59
+ const position = positionX + (config.line?step:seriesWidth) / 2;
61
60
  const labelPosition = isVertical
62
61
  ? getVerticalLabel({
63
62
  position: _position,
@@ -79,6 +79,7 @@ export default ({ axes, context: { width, height } }) => {
79
79
  : scaler.domain();
80
80
 
81
81
  let _ticks = allTicks;
82
+
82
83
  if (type === 'ordinal') {
83
84
  if (carousel === false) {
84
85
  _ticks = getTicksOfAxis(_ticks, +tickCount, showLast);