-
Notifications
You must be signed in to change notification settings - Fork 5
Rechart
gyim1345 edited this page Nov 27, 2020
·
5 revisions
Rechartsλ React λ° D3μΌλ‘ μμ±λ μ°¨νΈ λΌμ΄λΈλ¬λ¦¬λ€.
μ΄ λΌμ΄λΈλ¬λ¦¬μ μ£Όμ λͺ©μ μ κ³ ν΅ μμ΄ λ¦¬μ‘μ μ ν리μΌμ΄μ μμ μ°¨νΈλ₯Ό μμ±ν μ μλλ‘ λμμ£Όλ κ²μ΄λ€.
Rechartμ μ£Όμ μμΉμ λ€μκ³Ό κ°λ€.
- React componentλ‘ μ½κ² μ¬μ©.
- Native SVG μ§μ, μΌλΆ D3 submodulesμ νν΄ κ²½λν
- Declarative componentsμ΄κ³ , μ°¨νΈμ componentλ μμνκ² presentational νλ€.
λ¨, μ΄ λΌμ΄λΈλ¬λ¦¬ μ¬μ©μ μΈλΆ λΌμ΄λΈλ¬λ¦¬ d3-scaleκ³Ό d3-scale-chromaticμ μμ‘΄μ μ΄λ€.
μ)
<PieChart width={400} height={325}>
<Legend paylodUniqBy />
<Pie
data={data}
dataKey="value"
cx={200}
cy={125}
startAngle={180}
endAngle={-180}
innerRadius={60}
outerRadius={70}
label={renderLabelContent}
paddingAngle={5}
isAnimationActive={true}
>
{data.map((entry, index) => (
<Cell key={`slice-${index}`} fill={colors[index % 10]} />
))}
<Label width={50} position="center">
μ§μΆ
</Label>
</Pie>
</PieChart>