|
 |
|
ถามเรื่อง array กับ script คือ อยากทราบว่าเราจะเขียนคำสั่งอย่างไรให้สามารถ ส่งค่าที่เป็น อาเรย์ |
|
 |
|
|
 |
 |
|
Code (PHP)
<script type="text/javascript">
function chart(obj){
var so = new SWFObject("../actionscript/open-flash-chart.swf", "ofc", "752", "376", "9", "#FFFFFF");
//so.addVariable("data", "../data-files/data-20.txt");
so.addVariable("variables","true");
so.addVariable("title","กราฟฎีกาสะสม,{font-size: 20;}");
so.addVariable("y_legend","จำนวนฎีกา,12,#736AFF");
so.addVariable("x_legend","เดือน,12,#736AFF");
so.addVariable("y_label_size","15");
so.addVariable("y_ticks","5,10,4");
so.addVariable("area_hollow","2,3,25,#CC3399,ฎีกาสะสม พ.ศ. 2552,10");
so.addVariable("values",obj);
so.addVariable("x_labels","ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.");
so.addVariable("x_axis_steps","2");
so.addVariable("y_max","20");
so.addParam("allowScriptAccess", "always" );//"sameDomain");
so.write("my_chart");
}
</script>
<?php
$aa=array (9,9,9,9,19,9,9,9,9);
echo '<script>chart("$aa[0],$aa[1],$aa[2],$aa[3],$aa[4],$aa[5],$aa[6],$aa[7],$aa[8],")</script>'; ?>
คือ อยากทราบว่าเราจะเขียนคำสั่งอย่างไรให้สามารถ ส่งค่าที่เป็น อาเรย์ เข้าไปในฟังก์ชัน นี้อย่างไรครับ
เขียนแบบ ข้างบนแล้วมานแสดงผลแปลกอะครับ
ช่วยดูให้หน่อยนะครับ ขอบคุณครับ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-12 22:21:53 |
By :
sung55 |
View :
953 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
- - ' งะนอนกานหมดละ
|
 |
 |
 |
 |
Date :
2009-11-13 01:30:47 |
By :
sung55 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$aa=array (9,9,9,9,19,9,9,9,9);
echo "<script>";
echo "var ary = new Array('$aa[0]','$aa[1]','$aa[2]','$aa[3]','$aa[4]','$aa[5]','$aa[6]','$aa[7]','$aa[8]');";
echo "chart(ary);";
echo "</script>";
ลองแบบนี้ได้ไหม
|
 |
 |
 |
 |
Date :
2009-11-13 01:48:03 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้ครับ ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2009-11-13 08:48:55 |
By :
sung55 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|