I have a file called map.js which has the map and markers
{Towers.TowerList.map((tower) => (
<Marker key={tower.id}
position={tower.coords}
onClick={() => {
Drawgraph(tower); //Doubtful
setTower(tower)
}
} />
The setTower() comes from a React hook.
I want to plot a chartjs graph when a particular marker is clicked. But chart is to be made in D.js, while the information for clicked graph is in this one. I wanted so that Drawgraph() could determeine which dataset to use, make a chart and take the chart to D.js (where chart is to be displayed). This is what D.js looks like :
//somewhere in D.js
<div className="chart-wrapper">
<DrawGraph /> //Doubtful
</div>
How to go about this situation?