i want to use google chart map which is a piece of javascript code that take some data and display them on a map.
the chart data value are inside the javascript.
i need to retrive values from a mysql DB an insert them into the JS can i do this with php inside a js?
google.load('visualization', '1', {packages: ['geochart']});
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addRows(6);
data.addColumn('string', 'Country');
data.addColumn('number', 'Minds');
data.setValue(0, 0, 'Germany');
data.setValue(0, 1, 200);
data.setValue(1, 0, 'United States');
i need to take the instruction: data.setValue(0,0,'germany')
and change in something like, data.setValue()
can i do this?
i can create a .php page, first connect to the DB then store the data write the js with echo and put the variable there?
thank you for your suggestion,
regards.