I have this code in javascript for chart column:
$(function () {
$('#grafic_column').highcharts({
chart: {
type: 'column'
},
series: [{
name: 'Population',
data: [
['Shanghai', 23.7],
['Lagos', 16.1],
['Istanbul', 14.2]
]
}]
});
});
And this cod in php:
<?php
$ar = array(
['Shanghai', 23.7],
['Lagos', 16.1],
['Istanbul', 14.2]
);
echo json_encode($ar);
?>
How do import the values results from php in series.data:? Thank you!
data: [ <?php echo json_encode($ar); ?> ]?data: [ <?php include'myfile.php'; echo json_encode($ar); ?> ],and not work.myfiles.phpcontain your data? if so include it in the top of your script and assing the data content to $ar and just dodata: [ <?php echo json_encode($ar); ?> ]