สอบถามเรื่อง hightcharts ในส่วนของวันที่ครับ อยากให้มันแสดงเป็น ภาษาไทยครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา สอบถามเรื่อง hightcharts ในส่วนของวันที่ครับ อยากให้มันแสดงเป็น ภาษาไทยครับ
สอบถามเรื่อง hightcharts ในส่วนของวันที่ครับ อยากให้มันแสดงเป็น ภาษาไทยครับ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | <? include ( "config.inc.php" );?> <!DOCTYPE HTML> <html> <head> <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" > <title></title> <? $g_date1 = $_POST [ "g_date1" ]; $g_date2 = $_POST [ "g_date2" ]; if ( $g_date1 ){ $query_log =mysql_query( "select * from log_temp where log_date between '$g_date1' and '$g_date2' group by log_date order by log_date asc" ); } else { $query_log =mysql_query( "select * from log_temp where log_date LIKE '" . date ( "d-m-y" ). "' AND log_time between '" . $now_h . "' and '" . $now_h1 . "' order by log_id desc" ); } ?> <script type= "text/javascript" src= "js/jquery.min.js" ></script> <style type= "text/css" > ${demo.css} </style> <script type= "text/javascript" > $( function () { $( '#container' ).highcharts({ chart: { type: 'line' }, title: { text: '<? //echo"ข้อมูลของ วันที่ $g_date เวลา $g_hour";?>' }, subtitle: { text: '' }, xAxis: { categories: [<? // $query_log=mysql_query("select * from log_ph where log_date LIKE '".$g_date."' AND log_time between '".$hour1."' and '".$hour2."' order by log_id desc"); while ( $fetch_log =mysql_fetch_array( $query_log )){ echo "'" . $fetch_log ['log_date ']."' ,"; }?>] }, yAxis: { title: { text: 'Temperature (°C)' } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false } }, <? if ( $g_date1 ){ $query_log =mysql_query( "select avg(log_temp) as tavg from log_temp where log_date between '$g_date1' and '$g_date2' group by log_date order by log_date asc" ); } ?> series: [{ name: 'Average Temperature' , data: [<? // $query_log=mysql_query("select * from datalog where log_date LIKE '".$g_date."' AND log_time between '".$hour1."' and '".$hour2."' order by log_id desc"); while ( $fetch_log =mysql_fetch_array( $query_log )){ echo "" .number_format( $fetch_log [ 'tavg' ], 0, '.' , '' ). "," ; }?>] }] }); }); $( function () { $( "#datepicker" ).datepicker({ changeMonth: true, changeYear: true, yearRange: '-50:+0' , dateFormat: 'd/m/y' }); }); $( function () { $( "#datepicker2" ).datepicker({ changeMonth: true, changeYear: true, yearRange: '-50:+0' , dateFormat: 'd/m/y' }); }); </script> <link rel= "stylesheet" href= "script/jquery-ui.css" > <script src= "script/jquery-1.10.2.js" ></script> <script src= "script/jquery-ui.js" ></script> </head> <body> <script src= "js/highcharts.js" ></script> <center> <form method= "post" action= "" > From Date : <input id= "datepicker" name= "g_date1" type= "text" value= "<?=$g_date1;?>" /> To Date : <input id= "datepicker2" name= "g_date2" type= "text" value= "<?=$g_date2?>" /> <input type= "submit" value= "submit" > </form> <div id= "container" style= "min-width: 310px; height: 300px; margin: 0 auto" ></div> </body> </html> |
ตอนนี้มันแสดงเป็น ในส่วนของ xAxis: {
categories:
แสดงวันที่เป็น 2017/02/12 อยากให่เป้นภาษาไทยหรือไม่ก็กำหนดเป็น 12/02/2017 ประมาณนี้ครับ ต้องแก้ยังไง แก้ไมไ่ด้สักทีครับ
แสดงวันที่เป็น 2017/02/12 อยากให่เป้นภาษาไทยหรือไม่ก็กำหนดเป็น 12/02/2017 ประมาณนี้ครับ ต้องแก้ยังไง แก้ไมไ่ด้สักทีครับ

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ความคิดเห็นที่
1


ขอบคุณทุกการสนับสนุน
![]()