开发者

pass php array to jqplot chart

hi can one tell me how to pass php array to jqplot

this PHP:

Array ( [0] => 2882.89 [1] => 6913.46 ) 
Array ( [0] => 2006-01-01 [1] => 2006-01-02 ) 

to this 开发者_如何学CJavascript:

line4=[['2006-01-01', 2882.89], ['2006-01-02', 6913.46]];

this is exactly my code , can someone help, thx in advance


The line1 array in PHP should be:

$line1 = array( array("2010-1-1", 123) );

because you may have multiple data.

The following prints what you want:

echo "line1 = ";
echo json_encode($line1);
echo ";";


I know it's been a long time since this question has been asked, but just in case you need a way to have more php control over your jQplot charts, you may use a php wrapper like this one https://github.com/oumsofiane1/jqplotPHPwrapper.git

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜