dukDukz

[recharts] label is not showing 본문

웹 개발/React

[recharts] label is not showing

헤일리_HJ 2022. 8. 5. 15:46

https://stackoverflow.com/questions/55722306/label-list-is-not-showing-in-recharts

 

Label list is not showing in recharts?

Problem: I have created a bar chart using rechart. There I am using labelList component inside my bar chart. But It is not showing my label. This is how I organized my bar chart. import React, {

stackoverflow.com

그래서

isAnimationActive={false}
 
이렇게 해줬는데 

 

Warning: Received NaN for the `width` attribute. If this is expected, cast the value to a string.

 

이런 에러가 났다.

 

 

https://stackoverflow.com/questions/55806485/bar-charts-are-not-getting-displayed-in-react-js-using-recharts

 

Bar Charts are not getting displayed in React js using recharts

I am trying to build a Bar Chart using Recharts in React js. I am fetching the data from an API using fetch call and converting it to array.But when it displays the barCharts it is coming blank. C...

stackoverflow.com

찾아보니 props 로 받아오는 것의 데이터가 없으면 이런 에러가 뜰 수 있다고 한다.

props의 값이 없는 경우에는 초기값을 갖게 처리해주었다.