国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

html+js+highcharts繪制圓餅圖表的簡單實例

2019-11-20 09:18:30
字體:
來源:轉載
供稿:網友

實例如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>html+js+highcharts繪制圓餅圖表的簡單實例</title><script type="text/javascript" src="jquery-1.4.2.min.js" ></script><script type="text/javascript" src="highcharts.js" ></script> </head><body>  <div id="content">	<br><br><br><!--DEMO start--><div id="pie_chart" class="chart_combo"></div> <script type="text/javascript">  var chart; $(function () {   var totalMoney=999<span style="white-space:pre">	</span>var zccw=178<span style="white-space:pre">	</span>var sycw=821  $(document).ready(function() {    chart = new Highcharts.Chart({      chart: {        renderTo: 'pie_chart',        plotBackgroundColor: 'white',//背景顏色        plotBorderWidth: 0,        plotShadow: false      },      title: {        text: '總車位:'+totalMoney	+' 剩余車位:'+ sycw ,				verticalAlign:'bottom',				y:-60      },      tooltip: {//鼠標移動到每個餅圖顯示的內容        pointFormat: '{point.name}: <b>{point.percentage}%</b>',        percentageDecimals: 1,				formatter: function() {          return this.point.name+':'+totalMoney*this.point.percentage/100;        }      },       plotOptions: {        pie: {					size:'60%',					borderWidth: 0,          allowPointSelect: true,          cursor: 'pointer',          dataLabels: {					enabled: true,          color: '#000',											distance: -50,//通過設置這個屬性,將每個小餅圖的顯示名稱和每個餅圖重疊					style: {													fontSize: '10px',						lineHeight: '10px'					},					formatter: function(index) {	              return '<span style="color:#00008B;font-weight:bold">' + this.point.name + '</span>';            }         },				 padding:20        }      },      series: [{//設置每小個餅圖的顏色、名稱、百分比        type: 'pie',        name: null,        data: [          {name:'在場車輛',color:'#3DA9FF',y:zccw},					{name:'剩余車位',color:'#008FE0',y:sycw},					         ]      }]    });  });  });  </script> </div> </body></html>

以上這篇html+js+highcharts繪制圓餅圖表的簡單實例就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泽州县| 景德镇市| 綦江县| 镇赉县| 金秀| 阳城县| 剑河县| 分宜县| 宁晋县| 长岛县| 伽师县| 富阳市| 阜阳市| 唐河县| 河源市| 大邑县| 怀化市| 雷山县| 杭锦后旗| 双辽市| 宁武县| 巴林左旗| 乌拉特中旗| 南郑县| 石城县| 定结县| 漳州市| 玛纳斯县| 沙坪坝区| 临沂市| 丘北县| 枣强县| 神农架林区| 顺昌县| 满洲里市| 盐边县| 琼中| 大港区| 江口县| 玛曲县| 启东市|