123<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">4<title>highcharts example</title>5 6<?PHP7 $conn=mysql_connect("localhost", "root", "") or die("Connection Failed");8 mysql_query("Set Names UTF8",$conn);9 mysql_select_db("Office",$conn);Ten $sql= "SELECT Convert" (SUM (' Total2 '), Decimal (10,2)) as total, ' payment_date ' as Day from ' Toa_order ' WHERE timestampdiff (Day, ' Payment_date ', Date (now ())) <7 GROUP by ' Payment_date ' "; One $result=mysql_query($sql,$conn); A $day[] =Array(); - $count[] =Array(); - the while($row=Mysql_fetch_array($result)) - { - $day[]=$row[' Day ']; - $count[]=intval($row[' Total ']); + } - $day= Json_encode ($day); + A $data 1=Array(Array("Name" = "Day", "data" =$count)); at $data 1= Json_encode ($data 1);//converts the acquired data object into JSON format -?> - -<script type= "Text/javascript" src= "Http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js" ></script> -<script src= "Js/highcharts.js" ></script> -<script src= "Js/modules/exporting.js" ></script> in<script type= "Text/javascript" > -$(function () { to$ (' #container ').Highcharts ({ +Title { -Text: ' Publish times ', theX:-20//Center *}, $Subtitle {Panax NotoginsengText: ' Write By:dongge ', -X:-20 the}, +Xaxis: { ACategories: <?phpEcho $day;?> the}, +YAxis: { -Title { $Text: ' Amount ' $}, -Plotlines: [{ -value:0, theWidth:1, -Color: ' #808080 'Wuyi }] the}, -ToolTip { WuValuesuffix: ' Yuan ' -}, AboutLegend { $Layout: ' Vertical ', -Align: ' right ', -VerticalAlign: ' Middle ', -borderwidth:0 A}, +Series: <?phpEcho $data 1;?> the }); - }); $</script> the the the<body> the -<div id= "Container" style= "min-width:310px; height:400px; margin:0 Auto "></div> in the</body> theJs:highcharts.js, Jquery.highchartTable.js, jquery-1.8.2.min.js to be referenced
Php+mysql Line Chart