iT邦幫忙

0

SQL與PHP 讓輸出平均分給每個圓餅圖切片

不明 2019-06-30 23:55:551916 瀏覽

有以下問題想請問各位前輩
想了好久還是不知道該如何寫

以下是我的程式碼
https://ithelp.ithome.com.tw/upload/images/20190630/20112826ECMTyxH2OU.jpg

想讓輸出出來的數字,平均給每個圓餅圖
圖上顯示都排列在同一個圓餅圖切片
https://ithelp.ithome.com.tw/upload/images/20190630/20112826qiPuzMDU9N.jpg

小魚 iT邦大師 1 級 ‧ 2019-07-01 07:53:04 檢舉
問題重複了
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
海綿寶寶
iT邦大神 1 級 ‧ 2019-07-01 11:04:19
最佳解答

2015的答案

選我正解

看看JSFiddle是不是你要的
把不要顯示的變數刪掉即可

為免JSFiddle失效
Source code 如下

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container"></div>

$(function () {
	$('#container').highcharts({
		chart: {
			plotBackgroundColor: null,
			plotBorderWidth: null,
			plotShadow: false,
			type:'pie'
		},
			        
		title: {
			text: 'Browsers'
		},
			        
		subtitle: {
			text:false,
		},
		
		tooltip: {
			pointFormat: '{point.name}/{point.percentage:.1f}%/{point.custom}'
		},
		
		plotOptions: {
			pie: {
				allowPointSelect: true,
				cursor: 'pointer',
				dataLabels: {
					enabled: true,
					format: '<b>{point.name}</b>: {point.percentage:.1f} % {point.custom}',
					style: {
						color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
					}
				}
			}
		},
    		
		series: [{
			name: "Total",
			colorByPoint: true,
			data: [{
				name: "Firefox",
				y: 10,
        custom:"11111"
			}, {
				name: "Chrome",
				y: 12,
         custom:"22222"
			}, {
				name: "Explorer",
				y: 65,
         custom:"33333"
			}, {
				name: "Opera",
				y: 13,
         custom:"44444"
			}]
		}],
								        
	});
});

我要發表回答

立即登入回答