Hi I am setting some variables for highcharts in a Zend Report controller script like so:
$chartOptions = array(
"chart"=> array(
//chart type
"type" => "bar",
"spacingBottom" => 25
),
"height"=>1,
"title" => array(
"text" => $spm->getFullName()
),
etc.
the json I want to end up with also has this in:
exporting: {
buttons: {
exportButton: {
menuItems: [{
text: 'Export to PNG (with text)',
onclick: function() {
this.exportChart({},{
labels: {
items:[{
html: "System: x.x.x, Date/Time: 30:05:2012 14:32:00",
style: {
left: '50%',
top: '250px'
}
}]
}
});
}
}, {
text: 'Export to PNG (default)',
onclick: function() {
this.exportChart();
}
},
null,
null
]
}
}
}
So I need to setup the PHP array like so:
$chartOptions = array(
"chart"=> array(
//chart type
"type" => "bar",
"spacingBottom" => 25
),
"height"=>1,
"title" => array(
"text" => $spm->getFullName()
),
"exporting" => "buttons" =>
and so on. But I'm not sure how to do it because of the javascript function. The Zend report controller copies all the variables to the view script and I have no idea how it converts the php to json, but it does and it works :/ Sorry I can't be more helpful.
All I want is the outputted json to contain the javascript above, thanks!