我正在寫一個簡單的程序,它將打印高圖,但只有一個空白頁。我是否需要安裝任何程序才能運行Highchart?
我的代碼:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="Highcharts-2.2.2/js/highcharts.js"></script><script type="text/javascript">$(document).ready(function()var options={chart:{renderTo:'container',type:'spline'},title:{text:'survey data'},subtitle:{text:'from survey form'},
xAxis:{categories:['Jan 2008','Feb 2008','March 2008','April 2008','May 2008'],tickInterval:3},
yAxis:{title:`text:'Percentage %'},min:0
},plotOptions:{series:{lineWidth:2}},series:[{name:'Internet Explorer',data:[54.7,54.7,53.9,54.8,54.4,60.1,64.3,66.1]},{name:'FireFox',data:[36.7,36.1,37.0,39.1,39.8,40.1,43.7]},{name:'Safari',data:[1.9,2.0,2.1,2.2,2.4,2.6,2.8]},{
name:'Opera',data:[1.4,1,4,1.4,1.4,1.4,1.5,1.7,1.9]}]});});
</script>
</head>
<body>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"> </div>
</body>
</html>
我在XAMPP運行此作爲localhost/folder_name/file_name.php
我加入 'VAR圖表=新Highcharts.Chart(選項);'但仍然不工作:( –
你的jQuery的就緒功能看起來不正確:$(document).ready(function(){ var options .....}); – thepiyush13