0528 TIL

김형석·2022년 5월 29일
0

wanted-POB

목록 보기
19/26

💡새로 배운 내용

Victory js

  • labels
    <VictoryBar data={data_list} x='category' y='value' labels={({ datum }) => `${datum.value}`} />
    labels를 이용하면 그래프의 데이터를 라벨에 표현해 줄 수 있음.

  • Specifying x and y data
    const DUMMY_DATA_LIST = [
      { category: 'My', value: 750 },
      { category: '30대', value: 800 },
    ]
    
    return(
    	<VictoryBar data={DUMMY_DATA_LIST} x='category' y='value' labels={({ datum }) => `${datum.value}`} />
    )
    위와 같이 작성하면 x,y형태로 되지 않은 데이터도 chart에 써줄 수 있다
profile
코드로 소통하기 위해 힘쓰는 프론트엔드 개발자 입니다.

0개의 댓글