johnnyzh82 - 2014-03-07

I use php with open flash chart. I now have issue loading multiple charts in the javascript code, here is my code
// click event function
$( "tr.properties" ).click(function() {
// getting selected row in table
var selected_row = $(this).children().eq(0).text();
// binding function
function get_data_1()
{
alert( 'reading data of data_1' );
alert(JSON.stringify(data_1));
return JSON.stringify(data_1);
}
var data_1 = <?php echo getJSONObject($param1, $param2); ?>;

    function get_data_2()
    {
        alert( 'reading data of data_2' );
        alert(JSON.stringify(data_2));
        return JSON.stringify(data_2);
    }
    var data_2 = <?php echo getJSONObject($param1, $param2); ?>;

    // draw the two charts
    swfobject.embedSWF(
    "open-flash-chart.swf", "data-1",
    "600", "300", "9.0.0", "expressInstall.swf", { "get-data":"get_data_1" });

    swfobject.embedSWF(
    "open-flash-chart.swf", "data-2",
    "600", "300", "9.0.0", "expressInstall.swf", { "get-data":"get_data_2" } );
});


The problem is that the returned JSON object is not loaded at all. Is there a way to solve this problem?