@easyv/charts 1.8.8 → 1.8.9
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/Legend.js +19 -10
- package/package.json +1 -1
- package/src/components/Legend.js +19 -10
package/lib/components/Legend.js
CHANGED
|
@@ -148,6 +148,24 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
148
148
|
return parseFloat(getCanvasTextWidth(percentStr, percentFont.letterSpacing || 0, "".concat(percentFont.fontSize || 12, "px ").concat(percentFont.fontFamily || 'Arial')));
|
|
149
149
|
})));
|
|
150
150
|
var nameMaxWidth = ((_config$name = config.name) === null || _config$name === void 0 ? void 0 : _config$name.maxWidth) || 80;
|
|
151
|
+
var stylePieOrAxis = formatter ? _objectSpread(_objectSpread({
|
|
152
|
+
display: 'flex',
|
|
153
|
+
alignContent: alignment.split(" ")[0] == "center" && (alignment.split(" ")[1] == "left" || alignment.split(" ")[1] == "right") ? alignment.split(" ")[1] == "left" ? "flex-start" : "flex-end" : alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end",
|
|
154
|
+
flexDirection: "column",
|
|
155
|
+
position: 'absolute'
|
|
156
|
+
}, getPosition(position, _alignment, x, y)), {}, {
|
|
157
|
+
height: loop.show ? height : 'auto',
|
|
158
|
+
overflowY: loop.show ? 'scroll' : 'auto'
|
|
159
|
+
}) : _objectSpread(_objectSpread({
|
|
160
|
+
display: 'flex',
|
|
161
|
+
flexWrap: "wrap",
|
|
162
|
+
alignContent: alignment.split(" ")[0] == "center" && (alignment.split(" ")[1] == "left" || alignment.split(" ")[1] == "right") ? alignment.split(" ")[1] == "left" ? "flex-start" : "flex-end" : alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end",
|
|
163
|
+
flexDirection: "column",
|
|
164
|
+
position: 'absolute'
|
|
165
|
+
}, getPosition(position, _alignment, x, y)), {}, {
|
|
166
|
+
height: loop.show ? height : 'auto',
|
|
167
|
+
overflowY: loop.show ? 'scroll' : 'auto'
|
|
168
|
+
});
|
|
151
169
|
return LegendType == "FixedWidth" ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
170
|
className: "__easyv-legend-wrapper",
|
|
153
171
|
style: _objectSpread(_objectSpread({
|
|
@@ -201,16 +219,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
201
219
|
})));
|
|
202
220
|
}))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
203
221
|
className: "__easyv-legend-wrapper",
|
|
204
|
-
style:
|
|
205
|
-
display: 'flex',
|
|
206
|
-
flexWrap: "wrap",
|
|
207
|
-
alignContent: alignment.split(" ")[0] == "center" && (alignment.split(" ")[1] == "left" || alignment.split(" ")[1] == "right") ? alignment.split(" ")[1] == "left" ? "flex-start" : "flex-end" : alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end",
|
|
208
|
-
flexDirection: "column",
|
|
209
|
-
position: 'absolute'
|
|
210
|
-
}, getPosition(position, _alignment, x, y)), {}, {
|
|
211
|
-
height: loop.show ? height : 'auto',
|
|
212
|
-
overflowY: loop.show ? 'scroll' : 'auto'
|
|
213
|
-
}),
|
|
222
|
+
style: stylePieOrAxis,
|
|
214
223
|
ref: ref_container
|
|
215
224
|
}, (0, _toConsumableArray2["default"])(Array(Math.ceil(series.length / gridTemplateColumns))).map(function (_, indexs) {
|
|
216
225
|
return /*#__PURE__*/_react["default"].createElement("ul", {
|
package/package.json
CHANGED
package/src/components/Legend.js
CHANGED
|
@@ -123,6 +123,24 @@ export default memo(
|
|
|
123
123
|
);
|
|
124
124
|
const nameMaxWidth = config.name?.maxWidth || 80;
|
|
125
125
|
|
|
126
|
+
const stylePieOrAxis=formatter?{
|
|
127
|
+
display:'flex',
|
|
128
|
+
alignContent:alignment.split(" ")[0]=="center"&&(alignment.split(" ")[1]=="left"||alignment.split(" ")[1]=="right")?alignment.split(" ")[1]=="left"?"flex-start":"flex-end":alignment.split(" ")[0]=="left"?"flex-start":alignment.split(" ")[0]=="center"?"center":"flex-end",
|
|
129
|
+
flexDirection:"column",
|
|
130
|
+
position: 'absolute',
|
|
131
|
+
...getPosition(position, _alignment, x, y),
|
|
132
|
+
height: loop.show ? height : 'auto',
|
|
133
|
+
overflowY: loop.show ? 'scroll' : 'auto'
|
|
134
|
+
}:{
|
|
135
|
+
display:'flex',
|
|
136
|
+
flexWrap:"wrap",
|
|
137
|
+
alignContent:alignment.split(" ")[0]=="center"&&(alignment.split(" ")[1]=="left"||alignment.split(" ")[1]=="right")?alignment.split(" ")[1]=="left"?"flex-start":"flex-end":alignment.split(" ")[0]=="left"?"flex-start":alignment.split(" ")[0]=="center"?"center":"flex-end",
|
|
138
|
+
flexDirection: "column",
|
|
139
|
+
position: 'absolute',
|
|
140
|
+
...getPosition(position, _alignment, x, y),
|
|
141
|
+
height: loop.show ? height : 'auto',
|
|
142
|
+
overflowY: loop.show ? 'scroll' : 'auto'
|
|
143
|
+
}
|
|
126
144
|
return (
|
|
127
145
|
LegendType=="FixedWidth"?
|
|
128
146
|
<div
|
|
@@ -180,16 +198,7 @@ export default memo(
|
|
|
180
198
|
</ul>
|
|
181
199
|
</div>:<div
|
|
182
200
|
className='__easyv-legend-wrapper'
|
|
183
|
-
style={
|
|
184
|
-
display:'flex',
|
|
185
|
-
flexWrap:"wrap",
|
|
186
|
-
alignContent:alignment.split(" ")[0]=="center"&&(alignment.split(" ")[1]=="left"||alignment.split(" ")[1]=="right")?alignment.split(" ")[1]=="left"?"flex-start":"flex-end":alignment.split(" ")[0]=="left"?"flex-start":alignment.split(" ")[0]=="center"?"center":"flex-end",
|
|
187
|
-
flexDirection: "column",
|
|
188
|
-
position: 'absolute',
|
|
189
|
-
...getPosition(position, _alignment, x, y),
|
|
190
|
-
height: loop.show ? height : 'auto',
|
|
191
|
-
overflowY: loop.show ? 'scroll' : 'auto'
|
|
192
|
-
}}
|
|
201
|
+
style={stylePieOrAxis}
|
|
193
202
|
ref={ref_container}
|
|
194
203
|
>
|
|
195
204
|
|