我想將標籤對齊到餅圖的右側。目前它是最重要的。我該如何改變它?jQuery Flot庫標籤格式化和調整
這裏是我的代碼:
$json_ar = array(
["label"=> "Management Frames", "data"=> $cnt_mgt, "color"=> "#50D050"],
["label"=> "Control frames", "data"=> $cnt_control, "color"=> "#005CDE" ],
[ "label"=> "Data Frames", "data"=> $cnt_data, "color"=> "#A52A2A" ],
);
//Control vs Data vs Management
$json = encode_to_json($json_ar);
$pie = " <script type='text/javascript'>
$(function() { $.plot($('#cdm_pie'),$json,{series: {pie: {radius:120, show: true, label:{show:true, radius:0.5, formatter:function(label,series){var percent = Math.round(series.percent);return(' <b>'+percent+ '%</b>');} }}},legend:{show:true,}}); });
</script>";
$tables["cdm"]="<div id='wrapper' style='display: inline-flex'>
<div id='cdm_pie' style='float: none;width: 250px;height: 250px;'></div>
$pie
</div>";
它產生的輸出如下:
而且,我如何更改標籤的顏色從黑到白?
AKHIL嗨,只要改變容器的寬度。看到我張貼在下面的圖片.. –