码迷,mamicode.com
首页 > 其他好文 > 详细

highcharts实现饼状图

时间:2016-10-17 14:20:55      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="container" style="min-width:800px;height:400px;"></div>
<!--<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript" src="./node_modules/highcharts/highcharts.js"></script>-->
<script src=‘http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js‘></script>
<script src=‘http://cdn.hcharts.cn/highcharts/highcharts.js‘></script>
<script>
$(function () {
$(‘#container‘).highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: ‘你好‘
},
tooltip: {
pointFormat: ‘{series.name}: <b>{point.percentage:.1f}%</b>‘
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: ‘pointer‘,
dataLabels: {
enabled: true,
format: ‘<b>{point.name}</b>: {point.percentage:.1f} %‘,
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || ‘black‘
}
}
}
},
series: [{
type: ‘pie‘,
name: ‘Browser share‘,
data: [
[‘Firefox‘, 45.0],
[‘IE‘, 26.8],
{
name: ‘Chrome‘,
y: 12.8,
sliced: true,
selected: true
},
[‘Safari‘, 8.5],
[‘Opera‘, 6.2],
[‘Others‘, 0.7]
]
}]
});
});

</script>
</body>
</html>

highcharts实现饼状图

标签:

原文地址:http://www.cnblogs.com/xj198197/p/5969046.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!