TIL: victory.js로 캔들 차트 그리자(1) - 220606

Lumpen·2022년 6월 7일
0

TIL

목록 보기
40/242
post-thumbnail

앞으로의 과제

  • 차트 뜨기 전 스피너 추가

Keyword

victotory.js의 Candle Stick을 이용해 그릴 예정

import { VictoryChart, VictoryCandlestick, VictoryAxis } from 'victory'


<VictoryChart
          width={chartBoxSize?.chartWidth}
          height={chartBoxSize?.chartHeight}
          domainPadding={{ x: 25 }}
          scale={{ x: 'time' }}
        >
          <VictoryAxis tickFormat={(t) => `${t.getDate()}/${t.getMonth()}`} />
          <VictoryAxis dependentAxis />
          <VictoryCandlestick
            candleColors={{ positive: 'blue', negative: '#c43a31' }}
            data={data}
            style={{ data: { stroke: ({ datum }) => (datum.close > datum.open ? 'blue' : '#c43a31') } }}
          />
        </VictoryChart>

profile
떠돌이 생활을 하는. 실업자는 아니지만, 부랑 생활을 하는

0개의 댓글