본문 바로가기

■ Web개발/Rechart

recharts Tip

원그래프를 할 때 div를 어디에 두냐에 따라 좌표가 변하므로, 잘 잡아야함.

responsive container를 통해 높이 가로값을 두지 않아도 내부 값에 따라 변경됨.

<ResponsiveContainer width="95%" height={heightPercent}>

 

레퍼런스 라인

<ReferenceLine
            y="90"
            stroke="red"
            label={{ value: "90℃", position: "insideBottomLeft", fill: "red" }}
          />

y측 높이 제한 - domain

<YAxis tick={{ fill: "white" }} domain={[-10, 120]} />

 

간혹 오류가 있을 때는.. width를 99%로 조정하면 해결될 수 있다고 합니다.

저의 경우는 오류 없이 잘 작동했습니다.