I need help in implementing 15 mint candle in my react project. Current solution is not working #1376
Unanswered
arfat-sayyed
asked this question in
Q&A
Replies: 2 comments
-
My code getting fail in this function of library |
Beta Was this translation helpful? Give feedback.
0 replies
-
My answer is late, but looking at this, you've gotten the data for each 15 minute candlestick. I'm not exactly sure what function CandlestickChart() {
// grabs DOM element for the place to mount
const chartRef = useRef(null)
// used to manipulate the series
const seriesRef = useRef(null)
useEffect(() => {
// wait for the component to mount first
if (!chartRef.current) return
// mount the chart on a div
const chart = createChart(chartRef.current, {width: 400, height: 200}) // or other dimensions
seriesRef.current = chart.addCandlestickSeries()
seriesRef.current.setData(/*API data here*/) // you can pass in as props, fetch with useEffect etc.
// cleanup
return () => chart.remove()
}, [])
return <div id="chart" ref={chartRef} />
} I've put the candlestick series as a ref so that it should be possible to update the data using seriesRef.current.update(/* next candle data*/) There's a lot more configurations you can do like auto-sizing the chart container, formatting the time scale tick marks etc. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need help in implementing 15 mint candle in my react project.
The Error I am getting is this
and I data format array is this
and from Backend i am sending this data to my frontend with this function
and my OHLC on backend which i am fethcing from API is this format
Please help....I am stuck into this since 5days... I am not able to solve this
Beta Was this translation helpful? Give feedback.
All reactions