1,在首頁導入其js
2,在需要顯示的頁面添加一個div:<div id="chart-container-1" style="margin:5px 10px;width: 888px; height: 500px"></div>
3,在需要顯示的頁面添加js代碼:
<script type="text/javascript">
var chart1; // globally available
$(document).ready(function() {
chart1 = new Highcharts.Chart({
chart: {
renderTo: 'chart-container-1',
defaultSeriesType: 'bar'
},
title: {
text: '圖表'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: '圖標列名'
}
},
series: [{
name: 'Jane',
data: [5,6,7]
}]
});
$("tspan:last").hide();//注意,這個可以把廣告刪除掉,哈哈
});
</script>