@easyv/charts 1.9.12 → 1.9.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.
package/lib/components/Band.js
CHANGED
|
@@ -52,11 +52,12 @@ var getAttr = function getAttr(_ref) {
|
|
|
52
52
|
seriesWidth = _ref.seriesWidth,
|
|
53
53
|
length = _ref.length,
|
|
54
54
|
x = _ref.x,
|
|
55
|
-
y = _ref.y
|
|
55
|
+
y = _ref.y,
|
|
56
|
+
maxWidth = _ref.maxWidth;
|
|
56
57
|
var len = length ? length : 0.1; //柱子长度
|
|
57
58
|
if (isVertical) {
|
|
58
59
|
return {
|
|
59
|
-
width: Math.max(0, len),
|
|
60
|
+
width: Math.min(Math.max(0, len), maxWidth),
|
|
60
61
|
height: Math.max(0, seriesWidth),
|
|
61
62
|
x: y,
|
|
62
63
|
y: x,
|
|
@@ -69,9 +70,9 @@ var getAttr = function getAttr(_ref) {
|
|
|
69
70
|
};
|
|
70
71
|
} else {
|
|
71
72
|
return {
|
|
72
|
-
x: x,
|
|
73
|
+
x: seriesWidth > maxWidth ? x + (seriesWidth - maxWidth) / 2 : x,
|
|
73
74
|
y: y,
|
|
74
|
-
width: seriesWidth,
|
|
75
|
+
width: Math.min(seriesWidth, maxWidth),
|
|
75
76
|
height: len,
|
|
76
77
|
bgAttr: {
|
|
77
78
|
x: x,
|
|
@@ -95,6 +96,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
95
96
|
isControlChart = _ref3$isControlChart === void 0 ? false : _ref3$isControlChart,
|
|
96
97
|
setCtlTip = _ref3.setCtlTip,
|
|
97
98
|
isXRepeat = _ref3.isXRepeat,
|
|
99
|
+
maxWidth = _ref3.maxWidth,
|
|
98
100
|
_ref3$config = _ref3.config,
|
|
99
101
|
_ref3$config$pattern = _ref3$config.pattern,
|
|
100
102
|
pattern = _ref3$config$pattern === void 0 ? {} : _ref3$config$pattern,
|
|
@@ -237,7 +239,8 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
237
239
|
x: positionX,
|
|
238
240
|
y: positionY,
|
|
239
241
|
length: Math.abs(y1 - y2),
|
|
240
|
-
seriesWidth: seriesWidth
|
|
242
|
+
seriesWidth: seriesWidth,
|
|
243
|
+
maxWidth: maxWidth
|
|
241
244
|
}),
|
|
242
245
|
bgAttr = _getAttr.bgAttr,
|
|
243
246
|
attr = (0, _objectWithoutProperties2["default"])(_getAttr, _excluded3);
|
|
@@ -42,6 +42,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
42
42
|
animation = _ref$config$chart.animation,
|
|
43
43
|
legend = _ref$config$chart.legend,
|
|
44
44
|
selectStyle = _ref$config$chart.selectStyle,
|
|
45
|
+
maxWidth = _ref$config$chart.bar.maxWidth,
|
|
45
46
|
series = _ref$config.series,
|
|
46
47
|
bandLength = _ref$config.bandLength,
|
|
47
48
|
tooltip = _ref$config.tooltip,
|
|
@@ -625,7 +626,8 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
625
626
|
indicatorWidth: indicatorWidth,
|
|
626
627
|
triggerEvents: onInteraction,
|
|
627
628
|
setCtlTip: setCtlTip,
|
|
628
|
-
isXRepeat: isXRepeat
|
|
629
|
+
isXRepeat: isXRepeat,
|
|
630
|
+
maxWidth: maxWidth
|
|
629
631
|
}));
|
|
630
632
|
}), series.map(function (_ref3, index) {
|
|
631
633
|
var Component = _ref3.Component,
|
package/package.json
CHANGED
package/src/components/Band.tsx
CHANGED
|
@@ -30,17 +30,19 @@ const getAttr = ({
|
|
|
30
30
|
length,
|
|
31
31
|
x,
|
|
32
32
|
y,
|
|
33
|
+
maxWidth,
|
|
33
34
|
}: {
|
|
34
35
|
isVertical: boolean;
|
|
35
36
|
seriesWidth: number;
|
|
36
37
|
length: number;
|
|
37
38
|
x: number;
|
|
38
39
|
y: number;
|
|
40
|
+
maxWidth: number;
|
|
39
41
|
}) => {
|
|
40
42
|
const len = length ? length : 0.1; //柱子长度
|
|
41
43
|
if (isVertical) {
|
|
42
44
|
return {
|
|
43
|
-
width: Math.max(0, len),
|
|
45
|
+
width: Math.min(Math.max(0, len), maxWidth),
|
|
44
46
|
height: Math.max(0, seriesWidth),
|
|
45
47
|
x: y,
|
|
46
48
|
y: x,
|
|
@@ -53,9 +55,9 @@ const getAttr = ({
|
|
|
53
55
|
};
|
|
54
56
|
} else {
|
|
55
57
|
return {
|
|
56
|
-
x,
|
|
58
|
+
x: seriesWidth > maxWidth ? x + (seriesWidth - maxWidth) / 2 : x,
|
|
57
59
|
y,
|
|
58
|
-
width: seriesWidth,
|
|
60
|
+
width: Math.min(seriesWidth, maxWidth),
|
|
59
61
|
height: len,
|
|
60
62
|
bgAttr: {
|
|
61
63
|
x,
|
|
@@ -93,6 +95,7 @@ export default memo(
|
|
|
93
95
|
isControlChart = false,
|
|
94
96
|
setCtlTip,
|
|
95
97
|
isXRepeat,
|
|
98
|
+
maxWidth,
|
|
96
99
|
config: {
|
|
97
100
|
pattern = {},
|
|
98
101
|
seriesIntervalWidth: paddingInner = 0,
|
|
@@ -229,6 +232,7 @@ export default memo(
|
|
|
229
232
|
y: positionY,
|
|
230
233
|
length: Math.abs(y1 - y2),
|
|
231
234
|
seriesWidth,
|
|
235
|
+
maxWidth,
|
|
232
236
|
});
|
|
233
237
|
return (
|
|
234
238
|
<Fragment key={i}>
|
|
@@ -44,6 +44,7 @@ const Chart = memo(
|
|
|
44
44
|
animation,
|
|
45
45
|
legend,
|
|
46
46
|
selectStyle,
|
|
47
|
+
bar: { maxWidth },
|
|
47
48
|
},
|
|
48
49
|
series,
|
|
49
50
|
bandLength,
|
|
@@ -638,6 +639,7 @@ const Chart = memo(
|
|
|
638
639
|
triggerEvents={onInteraction}
|
|
639
640
|
setCtlTip={setCtlTip}
|
|
640
641
|
isXRepeat={isXRepeat}
|
|
642
|
+
maxWidth={maxWidth}
|
|
641
643
|
/>
|
|
642
644
|
)
|
|
643
645
|
);
|