Highcharts 3D柱形圖
配置
chart.options3d 配置
如下列出了 3D 圖的基本配置,設置 chart 的 type 屬性爲 column,options3d 選項可設置三維效果。php
var chart = { type: 'column', options3d: { enabled: true, //顯示圖表是否設置爲3D, 咱們將其設置爲 true alpha: 15, //圖表視圖旋轉角度 beta: 15, //圖表視圖旋轉角度 depth: 50, //圖表的合計深度,默認爲100 viewDistance: 25 //定義圖表的瀏覽長度 } };
實例
文件名:highcharts_3d_column.htmhtml
<html> <head> <meta charset="UTF-8" /> <title>Highcharts 教程 | 菜鳥教程(runoob.com)</title> <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/highcharts-3d.js"></script> </head> <body> <div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div> <div id="sliders"> <table> <tr><td>Alpha Angle</td><td><input id="R0" type="range" min="0" max="45" value="15"/> <span id="R0-value" class="value"></span></td></tr> <tr><td>Beta Angle</td><td><input id="R1" type="range" min="0" max="45" value="15"/> <span id="R1-value" class="value"></span></td></tr> </table> </div> <script language="JavaScript"> $(document).ready(function() { var chart = { renderTo: 'container', type: 'column', margin: 75, options3d: { enabled: true, alpha: 15, beta: 15, depth: 50, viewDistance: 25 } }; var title = { text: '圖表旋轉實例' }; var subtitle = { text: