-1

I have to open a popup when I click on the points of the map built with Leaflet library. In this popup i need to draw a chart, generated with the C3.js libray. How can I put the code of the chart into the Javascript poput to generate it?

1 Answers1

0

I am not providing the runnable codes , since your problem had no example codes ..

The logical solution of your problem

function createChart()
{
//--your stuff
return chartHTML;
}

Now create a function to open the popup , you may use some predefined or create as below

function openPopUp(points..)
{
//--creating div and showing centered with background pindrop
//--may be bootstrap modal will be helpful
popUp.innerHTML=createChart();
//--show PopUP and bind events to close the popup or something else
}

Now bind the openPopUp(points..) on click of your map.

Rohit Kumar
  • 1,948
  • 1
  • 11
  • 16