I am new to Tradingview charting library and I want to create like responsive chart.
The problem is, trading view charting library requires to specify width and height. Here is the code.
const chart = LightweightCharts.createChart(e, {
width: e.offsetWidth,
height: e.offsetHeight,
layout: {
backgroundColor: 'rgb(17, 17, 39)',
textColor: 'rgba(255, 255, 255, 0.9)',
},
grid: {
vertLines: {
color: 'rgb(41, 44, 58)',
},
horzLines: {
color: 'rgb(41, 44, 58)',
},
},
crosshair: {
mode: LightweightCharts.CrosshairMode.Normal,
},
priceScale: {
borderColor: 'rgba(197, 203, 206, 0.8)',
},
timeScale: {
borderColor: 'rgba(197, 203, 206, 0.8)',
},
});