I need some some help. I have a php file that make a count query into a database.
Then i have an index.html file witch use Highcharts script to make graph. I make an ajax call to return the count of my query like this:
$.ajax({
url: 'my.php',
success: function (response) {
var pro=response;
}
});
Now, i have to insert the var pro into the Highcharts data[..., ..., ... ] to plot my graph.
I don't know how i can insert this var into data[..., ..., ...,].
Someone have some idea?
Thanks a lot to all!!
Not sure about the structure of pro
. Provided it's a point struct, you could try this:
var chart = $('.chart').highcharts();
chart.series[0].addPoint([pro.x, pro.y]);
I advice to familiar with article about preprocessing data: http://www.highcharts.com/docs/working-with-data/preprocessing
In case when you load php file, you need to pring array with numbers, not string or JSON.