diff --git a/src/components/BulletWithSort.jsx b/src/components/BulletWithSort.jsx index 3821709..2a0746d 100644 --- a/src/components/BulletWithSort.jsx +++ b/src/components/BulletWithSort.jsx @@ -14,7 +14,7 @@ export default observer((props) => { const _max = Math.max(maxKPI, maxValue); const sortData = origin.sort(sortBy(measureField)).slice(-itemLength); // 顶格的值定在更远 - const _parseData = sortData?.map((ele) => ({ ...ele, [rangeField]: [0, Math.ceil(_max / 0.9)], [measureField]: [ele[measureField]], [targetField]: (ele?.targetField || 0) })); + const _parseData = sortData?.map((ele) => ({ ...ele, [rangeField]: [0, Math.ceil(_max / 0.9)], [measureField]: [ele[measureField]], [targetField]: (ele?.[targetField] || 0) })); return _parseData; }; diff --git a/src/components/Donut.jsx b/src/components/Donut.jsx index a18447a..0e5cc5c 100644 --- a/src/components/Donut.jsx +++ b/src/components/Donut.jsx @@ -13,7 +13,8 @@ export default observer((props) => { if (containerWidth < textWidth) { scale = Math.min(Math.sqrt(Math.abs(Math.pow(R, 2) / (Math.pow(textWidth / 2, 2) + Math.pow(textHeight, 2)))), 1); } - const textStyleStr = `width:${containerWidth}px;`; + // const textStyleStr = `width:${containerWidth}px;`; + const textStyleStr = `width:auto;`; return `