<!DOCTYPE html>
<html>
<head>
<title>TradingView Chart</title>
<script src="lightweightcharts.js"></script>
</head>
<body>
<div id="chartContainer" style="width: 800px; height: 600px;"></div>
<script>
const chart = LightweightCharts.createChart(document.getElementById('chartContainer'), {
width: 800,
height: 600,
});
const candlestickSeries = chart.addCandlestickSeries();
const intradayData = [
{ time: '2022-01-01 09:30', open: 100, high: 110, low: 90, close: 105 },
{ time: '2022-01-01 09:31', open: 105, high: 115, low: 100, close: 110 },
// ...
];
const formattedData = intradayData.map(data => ({
time: new Date(data.time),
open: data.open,
high: data.high,
low: data.low,
close: data.close,
}));
candlestickSeries.setData(formattedData);
</script>
</body>
</html>
so far i have used this but it's not working.i am trying to get 1minute data chart in tradingview style but it just shows overlapped candles coz of same date and says invalid date upon hovering