|
|
@ -93,13 +93,14 @@ function RingChart(props) { |
|
|
|
const { height, width } = props; |
|
|
|
const options = getOption(); |
|
|
|
const percent_colors = ['#24DDFA', '#267FD3', '#F8C86B',] |
|
|
|
const total = data?.reduce((p, c) => p + c.value, 0) |
|
|
|
const renderList = () => data.map((s, index) => ( |
|
|
|
<div key={s.name || index} className="type-leagle-item flex-row flex-item-center"> |
|
|
|
<div className="flex-row flex-item-center"> |
|
|
|
<div className="type-leagle-dot" style={{ background: percent_colors[index] }} /> |
|
|
|
<div className="type-leagle-label">{s.name}</div> |
|
|
|
</div> |
|
|
|
<div className="type-leagle-value">{s.value}个 <span style={{ fontSize: 14, color: percent_colors[index] }}>14%</span></div> |
|
|
|
<div className="type-leagle-value">{s.value}个 <span style={{ fontSize: 14, color: percent_colors[index] }}>{Math.round(s.value / total * 100)}%</span></div> |
|
|
|
</div> |
|
|
|
)); |
|
|
|
|
|
|
|