@easyv/charts 1.10.12 → 1.10.14
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 +68 -25
- package/lib/components/PieChart.js +26 -28
- package/lib/components/TextOverflow.js +2 -5
- package/lib/components/Tooltip.js +1 -2
- package/package.json +2 -2
- package/src/components/Legend.js +120 -93
- package/src/components/PieChart.js +28 -28
- package/src/components/TextOverflow.tsx +2 -3
- package/src/components/Tooltip.js +0 -1
package/lib/components/Legend.js
CHANGED
|
@@ -117,6 +117,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
117
117
|
_alignment$split2 = (0, _slicedToArray2["default"])(_alignment$split, 2),
|
|
118
118
|
_alignment = _alignment$split2[0],
|
|
119
119
|
position = _alignment$split2[1];
|
|
120
|
+
var legendMainAlign = alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end";
|
|
120
121
|
var length = _series.length;
|
|
121
122
|
var onClick = (0, _react.useCallback)(function (fieldName) {
|
|
122
123
|
return function (e) {
|
|
@@ -198,10 +199,8 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
198
199
|
overflowY: loop.show ? "scroll" : "auto"
|
|
199
200
|
}) : _objectSpread(_objectSpread({
|
|
200
201
|
width: "100%",
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
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",
|
|
204
|
-
flexDirection: "column",
|
|
202
|
+
maxWidth: "100%",
|
|
203
|
+
boxSizing: "border-box",
|
|
205
204
|
position: "absolute"
|
|
206
205
|
}, getPosition(position, _alignment, x, y)), {}, {
|
|
207
206
|
height: loop.show ? height : "auto",
|
|
@@ -270,16 +269,16 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
270
269
|
className: "__easyv-legend-wrapper",
|
|
271
270
|
style: stylePieOrAxis,
|
|
272
271
|
ref: ref_container
|
|
273
|
-
}, (0, _toConsumableArray2["default"])(Array(Math.ceil(series.length / gridTemplateColumns))).map(function (_, indexs) {
|
|
272
|
+
}, formatter ? (0, _toConsumableArray2["default"])(Array(Math.ceil(series.length / gridTemplateColumns))).map(function (_, indexs) {
|
|
274
273
|
return /*#__PURE__*/_react["default"].createElement("ul", {
|
|
275
274
|
key: indexs,
|
|
276
|
-
style:
|
|
275
|
+
style: {
|
|
277
276
|
display: "flex",
|
|
278
277
|
width: "fit-content",
|
|
279
|
-
justifyContent:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
278
|
+
justifyContent: legendMainAlign,
|
|
279
|
+
gap: "".concat(gridRowGap, "px ").concat(gridColumnGap, "px"),
|
|
280
|
+
marginBottom: gridRowGap + "px"
|
|
281
|
+
}
|
|
283
282
|
}, _series.map(function (series, i) {
|
|
284
283
|
if (Math.floor(i / gridTemplateColumns) == indexs) {
|
|
285
284
|
var _series$config2;
|
|
@@ -302,9 +301,9 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
302
301
|
alignItems: "center",
|
|
303
302
|
cursor: "pointer",
|
|
304
303
|
gap: _icon.gap,
|
|
305
|
-
overflow:
|
|
304
|
+
overflow: "visible"
|
|
306
305
|
}
|
|
307
|
-
}, formatter
|
|
306
|
+
}, formatter(series, _objectSpread(_objectSpread({}, config), {}, {
|
|
308
307
|
valueMaxWidth: valueMaxWidth,
|
|
309
308
|
percentMaxWidth: percentMaxWidth,
|
|
310
309
|
nameMaxWidth: nameMaxWidth,
|
|
@@ -312,22 +311,66 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
312
311
|
columnsSeries: columnsSeries,
|
|
313
312
|
fieldColumnKeys: fieldColumnKeys,
|
|
314
313
|
fieldsColumnWidths: fieldsColumnWidths
|
|
315
|
-
})) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
316
|
-
style: _icon
|
|
317
|
-
}), /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
|
|
318
|
-
ShowType: LegendType,
|
|
319
|
-
type: "ellipsis",
|
|
320
|
-
value: displayName || name,
|
|
321
|
-
style: _objectSpread(_objectSpread({}, font), {}, {
|
|
322
|
-
fontStyle: italic ? "italic" : "normal",
|
|
323
|
-
fontWeight: bold ? "bold" : "normal",
|
|
324
|
-
minWidth: getCanvasTextWidth(displayName ? displayName.substring(0, 5) || name.substring(0, 5) : "", font.letterSpacing, "".concat(font.fontSize, "px ").concat(font.fontFamily))
|
|
325
|
-
}),
|
|
326
|
-
speed: speed
|
|
327
314
|
})));
|
|
328
315
|
}
|
|
329
316
|
}));
|
|
330
|
-
})
|
|
317
|
+
}) : /*#__PURE__*/_react["default"].createElement("ul", {
|
|
318
|
+
style: {
|
|
319
|
+
display: "flex",
|
|
320
|
+
flexDirection: "row",
|
|
321
|
+
flexWrap: "wrap",
|
|
322
|
+
width: "100%",
|
|
323
|
+
maxWidth: "100%",
|
|
324
|
+
boxSizing: "border-box",
|
|
325
|
+
margin: 0,
|
|
326
|
+
padding: 0,
|
|
327
|
+
listStyle: "none",
|
|
328
|
+
justifyContent: legendMainAlign,
|
|
329
|
+
gap: "".concat(gridRowGap, "px ").concat(gridColumnGap, "px")
|
|
330
|
+
}
|
|
331
|
+
}, _series.map(function (series, i) {
|
|
332
|
+
var _series$config3;
|
|
333
|
+
var type = series.type,
|
|
334
|
+
name = series.name,
|
|
335
|
+
displayName = series.displayName,
|
|
336
|
+
fieldName = series.fieldName,
|
|
337
|
+
icon = series.icon,
|
|
338
|
+
selected = series.selected,
|
|
339
|
+
index = series.index;
|
|
340
|
+
var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config3 = series.config) === null || _series$config3 === void 0 || (_series$config3 = _series$config3.line) === null || _series$config3 === void 0 ? void 0 : _series$config3.type);
|
|
341
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
342
|
+
key: i,
|
|
343
|
+
onClick: onClick(fieldName),
|
|
344
|
+
"data-name": displayName || name,
|
|
345
|
+
"data-index": index,
|
|
346
|
+
style: {
|
|
347
|
+
display: "inline-flex",
|
|
348
|
+
alignItems: "center",
|
|
349
|
+
maxWidth: "100%",
|
|
350
|
+
minWidth: 0,
|
|
351
|
+
boxSizing: "border-box",
|
|
352
|
+
verticalAlign: "middle",
|
|
353
|
+
opacity: selected === false ? opacity / 100 : 1,
|
|
354
|
+
cursor: "pointer",
|
|
355
|
+
gap: _icon.gap
|
|
356
|
+
}
|
|
357
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
358
|
+
style: _objectSpread(_objectSpread({}, _icon), {}, {
|
|
359
|
+
flexShrink: 0
|
|
360
|
+
})
|
|
361
|
+
}), /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
|
|
362
|
+
type: "ellipsis",
|
|
363
|
+
value: displayName || name,
|
|
364
|
+
style: _objectSpread(_objectSpread({}, font), {}, {
|
|
365
|
+
fontStyle: italic ? "italic" : "normal",
|
|
366
|
+
fontWeight: bold ? "bold" : "normal",
|
|
367
|
+
minWidth: 0,
|
|
368
|
+
flex: "1 1 0%",
|
|
369
|
+
maxWidth: "100%"
|
|
370
|
+
}),
|
|
371
|
+
speed: speed
|
|
372
|
+
}));
|
|
373
|
+
})));
|
|
331
374
|
});
|
|
332
375
|
var getPosition = function getPosition(position, alignment) {
|
|
333
376
|
var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -605,10 +605,21 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
605
605
|
},
|
|
606
606
|
arcs: _arcs,
|
|
607
607
|
judge: judgeData
|
|
608
|
-
}))),
|
|
608
|
+
}))), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
609
|
+
height: chartHeight,
|
|
610
|
+
columnsSeries: columnsSeries,
|
|
611
|
+
data: data,
|
|
612
|
+
series: _arcs.map(function (arc) {
|
|
613
|
+
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
614
|
+
percent: arc.percent.toFixed(legendPrecision)
|
|
615
|
+
});
|
|
616
|
+
}),
|
|
617
|
+
pieClick: onClick,
|
|
618
|
+
formatter: formatter,
|
|
619
|
+
judge: judgeData
|
|
620
|
+
})), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement("div", {
|
|
609
621
|
style: {
|
|
610
622
|
position: "absolute",
|
|
611
|
-
zIndex: 9999,
|
|
612
623
|
pointerEvents: "none"
|
|
613
624
|
}
|
|
614
625
|
}, /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
|
|
@@ -621,18 +632,6 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
621
632
|
y: maxRadius + marginTop
|
|
622
633
|
},
|
|
623
634
|
mousePos: mousePos
|
|
624
|
-
})), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
625
|
-
height: chartHeight,
|
|
626
|
-
columnsSeries: columnsSeries,
|
|
627
|
-
data: data,
|
|
628
|
-
series: _arcs.map(function (arc) {
|
|
629
|
-
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
630
|
-
percent: arc.percent.toFixed(legendPrecision)
|
|
631
|
-
});
|
|
632
|
-
}),
|
|
633
|
-
pieClick: onClick,
|
|
634
|
-
formatter: formatter,
|
|
635
|
-
judge: judgeData
|
|
636
635
|
}))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
637
636
|
ref: domRef
|
|
638
637
|
}, /*#__PURE__*/_react["default"].createElement(_.ChartContainer, {
|
|
@@ -776,10 +775,21 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
776
775
|
config: decorate,
|
|
777
776
|
arcs: _arcs,
|
|
778
777
|
radius: radius
|
|
779
|
-
}),
|
|
778
|
+
}), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
779
|
+
height: chartHeight,
|
|
780
|
+
data: data,
|
|
781
|
+
columnsSeries: columnsSeries,
|
|
782
|
+
series: _arcs.map(function (arc) {
|
|
783
|
+
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
784
|
+
percent: arc.percent.toFixed(legendPrecision)
|
|
785
|
+
});
|
|
786
|
+
}),
|
|
787
|
+
pieClick: onClick,
|
|
788
|
+
formatter: formatter,
|
|
789
|
+
judge: judgeData
|
|
790
|
+
})), tooltip && mousePos && mousePos.x != 0 && mousePos.y != 0 && tooltip.manual && /*#__PURE__*/_react["default"].createElement("div", {
|
|
780
791
|
style: {
|
|
781
792
|
position: "absolute",
|
|
782
|
-
zIndex: 9999,
|
|
783
793
|
pointerEvents: "none"
|
|
784
794
|
}
|
|
785
795
|
}, /*#__PURE__*/_react["default"].createElement(_PieTooltip.PieTooltip, {
|
|
@@ -792,18 +802,6 @@ var Component = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
|
792
802
|
y: maxRadius + marginTop
|
|
793
803
|
},
|
|
794
804
|
mousePos: mousePos
|
|
795
|
-
})), /*#__PURE__*/_react["default"].createElement(_.Legend, (0, _extends2["default"])({}, legend, {
|
|
796
|
-
height: chartHeight,
|
|
797
|
-
data: data,
|
|
798
|
-
columnsSeries: columnsSeries,
|
|
799
|
-
series: _arcs.map(function (arc) {
|
|
800
|
-
return _objectSpread(_objectSpread({}, arc), {}, {
|
|
801
|
-
percent: arc.percent.toFixed(legendPrecision)
|
|
802
|
-
});
|
|
803
|
-
}),
|
|
804
|
-
pieClick: onClick,
|
|
805
|
-
formatter: formatter,
|
|
806
|
-
judge: judgeData
|
|
807
805
|
})));
|
|
808
806
|
});
|
|
809
807
|
var Current = function Current(_ref9) {
|
|
@@ -24,8 +24,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
|
|
|
24
24
|
_props$speed = props.speed,
|
|
25
25
|
speed = _props$speed === void 0 ? 5 : _props$speed,
|
|
26
26
|
_props$config = props.config,
|
|
27
|
-
config = _props$config === void 0 ? {} : _props$config
|
|
28
|
-
ShowType = props.ShowType;
|
|
27
|
+
config = _props$config === void 0 ? {} : _props$config;
|
|
29
28
|
var _config$needTitle = config.needTitle,
|
|
30
29
|
needTitle = _config$needTitle === void 0 ? true : _config$needTitle;
|
|
31
30
|
var getTextOverflow = function getTextOverflow(type) {
|
|
@@ -62,9 +61,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
|
|
|
62
61
|
style: styles,
|
|
63
62
|
ref: ref
|
|
64
63
|
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
65
|
-
style: _objectSpread(
|
|
66
|
-
whiteSpace: ShowType == "Adaptive" ? "normal" : styles.whiteSpace
|
|
67
|
-
}),
|
|
64
|
+
style: _objectSpread({}, styles),
|
|
68
65
|
ref: ref,
|
|
69
66
|
title: needTitle && type == "ellipsis" ? text || undefined : undefined,
|
|
70
67
|
dangerouslySetInnerHTML: {
|
|
@@ -99,8 +99,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
|
|
|
99
99
|
}, (0, _utils.getFontStyle)(font)), {}, {
|
|
100
100
|
width: "fit-content",
|
|
101
101
|
maxWidth: "none",
|
|
102
|
-
overflow: "visible"
|
|
103
|
-
zIndex: 9999
|
|
102
|
+
overflow: "visible"
|
|
104
103
|
})
|
|
105
104
|
}, formatter ? formatter({
|
|
106
105
|
series: series,
|
package/package.json
CHANGED
package/src/components/Legend.js
CHANGED
|
@@ -87,6 +87,12 @@ export default memo(
|
|
|
87
87
|
|
|
88
88
|
const _series = sortPie(series, order, columnsSeries);
|
|
89
89
|
const [_alignment, position] = alignment.split(" ");
|
|
90
|
+
const legendMainAlign =
|
|
91
|
+
alignment.split(" ")[0] == "left"
|
|
92
|
+
? "flex-start"
|
|
93
|
+
: alignment.split(" ")[0] == "center"
|
|
94
|
+
? "center"
|
|
95
|
+
: "flex-end";
|
|
90
96
|
const length = _series.length;
|
|
91
97
|
|
|
92
98
|
const onClick = useCallback(
|
|
@@ -221,21 +227,8 @@ export default memo(
|
|
|
221
227
|
}
|
|
222
228
|
: {
|
|
223
229
|
width: "100%",
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
alignContent:
|
|
227
|
-
alignment.split(" ")[0] == "center" &&
|
|
228
|
-
(alignment.split(" ")[1] == "left" ||
|
|
229
|
-
alignment.split(" ")[1] == "right")
|
|
230
|
-
? alignment.split(" ")[1] == "left"
|
|
231
|
-
? "flex-start"
|
|
232
|
-
: "flex-end"
|
|
233
|
-
: alignment.split(" ")[0] == "left"
|
|
234
|
-
? "flex-start"
|
|
235
|
-
: alignment.split(" ")[0] == "center"
|
|
236
|
-
? "center"
|
|
237
|
-
: "flex-end",
|
|
238
|
-
flexDirection: "column",
|
|
230
|
+
maxWidth: "100%",
|
|
231
|
+
boxSizing: "border-box",
|
|
239
232
|
position: "absolute",
|
|
240
233
|
...getPosition(position, _alignment, x, y),
|
|
241
234
|
height: loop.show ? height : "auto",
|
|
@@ -326,53 +319,47 @@ export default memo(
|
|
|
326
319
|
style={stylePieOrAxis}
|
|
327
320
|
ref={ref_container}
|
|
328
321
|
>
|
|
329
|
-
{
|
|
330
|
-
(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
gap: _icon.gap,
|
|
371
|
-
overflow: formatter ? "visible" : undefined,
|
|
372
|
-
}}
|
|
373
|
-
>
|
|
374
|
-
{formatter ? (
|
|
375
|
-
formatter(series, {
|
|
322
|
+
{formatter ? (
|
|
323
|
+
[...Array(Math.ceil(series.length / gridTemplateColumns))].map(
|
|
324
|
+
(_, indexs) => (
|
|
325
|
+
<ul
|
|
326
|
+
key={indexs}
|
|
327
|
+
style={{
|
|
328
|
+
display: "flex",
|
|
329
|
+
width: "fit-content",
|
|
330
|
+
justifyContent: legendMainAlign,
|
|
331
|
+
gap: `${gridRowGap}px ${gridColumnGap}px`,
|
|
332
|
+
marginBottom: gridRowGap + "px",
|
|
333
|
+
}}
|
|
334
|
+
>
|
|
335
|
+
{_series.map((series, i) => {
|
|
336
|
+
if (Math.floor(i / gridTemplateColumns) == indexs) {
|
|
337
|
+
const {
|
|
338
|
+
type,
|
|
339
|
+
name,
|
|
340
|
+
displayName,
|
|
341
|
+
fieldName,
|
|
342
|
+
icon,
|
|
343
|
+
selected,
|
|
344
|
+
index,
|
|
345
|
+
} = series;
|
|
346
|
+
const _icon = getIcon(type, icon, series?.config?.line?.type);
|
|
347
|
+
return (
|
|
348
|
+
<li
|
|
349
|
+
key={i}
|
|
350
|
+
onClick={onClick(fieldName)}
|
|
351
|
+
data-name={displayName || name}
|
|
352
|
+
data-index={index}
|
|
353
|
+
style={{
|
|
354
|
+
display: "flex",
|
|
355
|
+
opacity: selected === false ? opacity / 100 : 1,
|
|
356
|
+
alignItems: "center",
|
|
357
|
+
cursor: "pointer",
|
|
358
|
+
gap: _icon.gap,
|
|
359
|
+
overflow: "visible",
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
362
|
+
{formatter(series, {
|
|
376
363
|
...config,
|
|
377
364
|
valueMaxWidth,
|
|
378
365
|
percentMaxWidth,
|
|
@@ -381,37 +368,77 @@ export default memo(
|
|
|
381
368
|
columnsSeries,
|
|
382
369
|
fieldColumnKeys,
|
|
383
370
|
fieldsColumnWidths,
|
|
384
|
-
})
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
371
|
+
})}
|
|
372
|
+
</li>
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
})}
|
|
376
|
+
</ul>
|
|
377
|
+
),
|
|
378
|
+
)
|
|
379
|
+
) : (
|
|
380
|
+
<ul
|
|
381
|
+
style={{
|
|
382
|
+
display: "flex",
|
|
383
|
+
flexDirection: "row",
|
|
384
|
+
flexWrap: "wrap",
|
|
385
|
+
width: "100%",
|
|
386
|
+
maxWidth: "100%",
|
|
387
|
+
boxSizing: "border-box",
|
|
388
|
+
margin: 0,
|
|
389
|
+
padding: 0,
|
|
390
|
+
listStyle: "none",
|
|
391
|
+
justifyContent: legendMainAlign,
|
|
392
|
+
gap: `${gridRowGap}px ${gridColumnGap}px`,
|
|
393
|
+
}}
|
|
394
|
+
>
|
|
395
|
+
{_series.map((series, i) => {
|
|
396
|
+
const {
|
|
397
|
+
type,
|
|
398
|
+
name,
|
|
399
|
+
displayName,
|
|
400
|
+
fieldName,
|
|
401
|
+
icon,
|
|
402
|
+
selected,
|
|
403
|
+
index,
|
|
404
|
+
} = series;
|
|
405
|
+
const _icon = getIcon(type, icon, series?.config?.line?.type);
|
|
406
|
+
return (
|
|
407
|
+
<li
|
|
408
|
+
key={i}
|
|
409
|
+
onClick={onClick(fieldName)}
|
|
410
|
+
data-name={displayName || name}
|
|
411
|
+
data-index={index}
|
|
412
|
+
style={{
|
|
413
|
+
display: "inline-flex",
|
|
414
|
+
alignItems: "center",
|
|
415
|
+
maxWidth: "100%",
|
|
416
|
+
minWidth: 0,
|
|
417
|
+
boxSizing: "border-box",
|
|
418
|
+
verticalAlign: "middle",
|
|
419
|
+
opacity: selected === false ? opacity / 100 : 1,
|
|
420
|
+
cursor: "pointer",
|
|
421
|
+
gap: _icon.gap,
|
|
422
|
+
}}
|
|
423
|
+
>
|
|
424
|
+
<span style={{ ..._icon, flexShrink: 0 }} />
|
|
425
|
+
<TextOverflow
|
|
426
|
+
type="ellipsis"
|
|
427
|
+
value={displayName || name}
|
|
428
|
+
style={{
|
|
429
|
+
...font,
|
|
430
|
+
fontStyle: italic ? "italic" : "normal",
|
|
431
|
+
fontWeight: bold ? "bold" : "normal",
|
|
432
|
+
minWidth: 0,
|
|
433
|
+
flex: "1 1 0%",
|
|
434
|
+
maxWidth: "100%",
|
|
435
|
+
}}
|
|
436
|
+
speed={speed}
|
|
437
|
+
/>
|
|
438
|
+
</li>
|
|
439
|
+
);
|
|
440
|
+
})}
|
|
441
|
+
</ul>
|
|
415
442
|
)}
|
|
416
443
|
</div>
|
|
417
444
|
);
|
|
@@ -622,6 +622,20 @@ const Component = memo(
|
|
|
622
622
|
)}
|
|
623
623
|
</g>
|
|
624
624
|
</ChartContainer>
|
|
625
|
+
|
|
626
|
+
<Legend
|
|
627
|
+
{...legend}
|
|
628
|
+
height={chartHeight}
|
|
629
|
+
columnsSeries={columnsSeries}
|
|
630
|
+
data={data}
|
|
631
|
+
series={_arcs.map((arc) => ({
|
|
632
|
+
...arc,
|
|
633
|
+
percent: arc.percent.toFixed(legendPrecision),
|
|
634
|
+
}))}
|
|
635
|
+
pieClick={onClick}
|
|
636
|
+
formatter={formatter}
|
|
637
|
+
judge={judgeData}
|
|
638
|
+
/>
|
|
625
639
|
{tooltip &&
|
|
626
640
|
mousePos &&
|
|
627
641
|
mousePos.x != 0 &&
|
|
@@ -630,7 +644,6 @@ const Component = memo(
|
|
|
630
644
|
<div
|
|
631
645
|
style={{
|
|
632
646
|
position: "absolute",
|
|
633
|
-
zIndex: 9999,
|
|
634
647
|
pointerEvents: "none",
|
|
635
648
|
}}
|
|
636
649
|
>
|
|
@@ -647,19 +660,6 @@ const Component = memo(
|
|
|
647
660
|
/>
|
|
648
661
|
</div>
|
|
649
662
|
)}
|
|
650
|
-
<Legend
|
|
651
|
-
{...legend}
|
|
652
|
-
height={chartHeight}
|
|
653
|
-
columnsSeries={columnsSeries}
|
|
654
|
-
data={data}
|
|
655
|
-
series={_arcs.map((arc) => ({
|
|
656
|
-
...arc,
|
|
657
|
-
percent: arc.percent.toFixed(legendPrecision),
|
|
658
|
-
}))}
|
|
659
|
-
pieClick={onClick}
|
|
660
|
-
formatter={formatter}
|
|
661
|
-
judge={judgeData}
|
|
662
|
-
/>
|
|
663
663
|
</div>
|
|
664
664
|
) : (
|
|
665
665
|
<div ref={domRef}>
|
|
@@ -893,6 +893,20 @@ const Component = memo(
|
|
|
893
893
|
radius={radius}
|
|
894
894
|
/>
|
|
895
895
|
)}
|
|
896
|
+
|
|
897
|
+
<Legend
|
|
898
|
+
{...legend}
|
|
899
|
+
height={chartHeight}
|
|
900
|
+
data={data}
|
|
901
|
+
columnsSeries={columnsSeries}
|
|
902
|
+
series={_arcs.map((arc) => ({
|
|
903
|
+
...arc,
|
|
904
|
+
percent: arc.percent.toFixed(legendPrecision),
|
|
905
|
+
}))}
|
|
906
|
+
pieClick={onClick}
|
|
907
|
+
formatter={formatter}
|
|
908
|
+
judge={judgeData}
|
|
909
|
+
/>
|
|
896
910
|
{tooltip &&
|
|
897
911
|
mousePos &&
|
|
898
912
|
mousePos.x != 0 &&
|
|
@@ -901,7 +915,6 @@ const Component = memo(
|
|
|
901
915
|
<div
|
|
902
916
|
style={{
|
|
903
917
|
position: "absolute",
|
|
904
|
-
zIndex: 9999,
|
|
905
918
|
pointerEvents: "none",
|
|
906
919
|
}}
|
|
907
920
|
>
|
|
@@ -918,19 +931,6 @@ const Component = memo(
|
|
|
918
931
|
/>
|
|
919
932
|
</div>
|
|
920
933
|
)}
|
|
921
|
-
<Legend
|
|
922
|
-
{...legend}
|
|
923
|
-
height={chartHeight}
|
|
924
|
-
data={data}
|
|
925
|
-
columnsSeries={columnsSeries}
|
|
926
|
-
series={_arcs.map((arc) => ({
|
|
927
|
-
...arc,
|
|
928
|
-
percent: arc.percent.toFixed(legendPrecision),
|
|
929
|
-
}))}
|
|
930
|
-
pieClick={onClick}
|
|
931
|
-
formatter={formatter}
|
|
932
|
-
judge={judgeData}
|
|
933
|
-
/>
|
|
934
934
|
</div>
|
|
935
935
|
);
|
|
936
936
|
},
|
|
@@ -11,7 +11,8 @@ interface flowText {
|
|
|
11
11
|
speed: number;
|
|
12
12
|
style: CSSProperties;
|
|
13
13
|
config?: any;
|
|
14
|
-
|
|
14
|
+
/** 历史兼容字段,图例等调用方可能传入,已不再影响省略号换行行为 */
|
|
15
|
+
ShowType?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default memo(
|
|
@@ -22,7 +23,6 @@ export default memo(
|
|
|
22
23
|
style, // 样式
|
|
23
24
|
speed = 5, // 动画速度
|
|
24
25
|
config = {},
|
|
25
|
-
ShowType,
|
|
26
26
|
} = props;
|
|
27
27
|
const { needTitle = true } = config;
|
|
28
28
|
|
|
@@ -64,7 +64,6 @@ export default memo(
|
|
|
64
64
|
<div
|
|
65
65
|
style={{
|
|
66
66
|
...styles,
|
|
67
|
-
whiteSpace: ShowType == "Adaptive" ? "normal" : styles.whiteSpace,
|
|
68
67
|
}}
|
|
69
68
|
ref={ref}
|
|
70
69
|
title={needTitle && type == "ellipsis" ? text || undefined : undefined}
|