I am creating an application that shows charts and to load the chart, I need to write the following lines of code:
const line_chart = new GoogleCharts.api.visualization.LineChart(document.getElementById('chart-div'));
line_chart.draw(data, options);
This chart-div
is inside another component called <ChartComponent/>
.
Is it possible to access chart-div
without using document.getElementById
?