I'm using Google Charts and I need to update a map that is already instantiated as a valid map , I actually want it when I click the refresh the data from within a map button.
Today I'm doing it this way:
var dataGraf = google.visualization.arrayToDataTable(parsVal);
var chart = document.getElementById('curve_chart');
chart.draw(dataGraf);
But nothing happens. For me to instantiate my map I used the following commands:
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable(parsVal);
var options = {
title: 'Membros x Visitantes',
curveType: 'function',
legend: { position: 'bottom' }
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
How can I do to update, just when I click the button. Remembering that my dataGraf
has my array with the new values.
I did a JsFiddle to exemplify my problem.