JQuery flot pie chart plugin简单例子
来源:互联网 发布:微商加粉软件免费下载 编辑:程序博客网 时间:2024/05/16 14:42
<html>
<head>
<title>饼图</title>
<!--[if IE]><script language="javascript" type="text/javascript" src="flot/excanvas.min.js"></script><![endif]-->
<script type="text/javascript" src="media/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="media/js/jquery.flot.js"></script>
<script type="text/javascript" src="media/js/jquery.flot.pie.js"></script>
</head>
<body>
<div id="pieChart" style="width: 400px; height: 300px">
</div>
</body>
<script type="text/javascript">
$(function () {
var optionPie = {
series: {
pie: {
show: true,
radius: 'auto', // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
innerRadius: 0,
startAngle: 3 / 2,
tilt: 0.8,
offset: {
top: 0,
left: 'auto'
},
stroke: {
color: '#FFF',
width: 1
},
label: {
show: true,
formatter: function (label, slice) {
return '<div style="font-size:x-small;text-align:center;padding:2px;color:' + slice.color + ';">' + label + '<br/>' + Math.round(slice.percent) + '%</div>';
}, // formatter function
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
background: {
color: null,
opacity: 0
},
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
},
combine: {
threshold: -1, // percentage at which to combine little slices into one larger slice
color: null, // color to give the new slice (auto-generated if null)
label: 'Other' // label to give the new slice
},
highlight: {
//color: '#FFF', // will add this functionality once parseColor is available
opacity: 0.5
}
}
}
};
var pieData = [
{ label: "Jan", data: [[1, 20]] },
{ label: "Feb", data: [[1, 20]] },
{ label: "March", data: [[1, 20]] }
];
$.plot($("#pieChart"), pieData, optionPie);
});
</script>
<head>
<title>饼图</title>
<!--[if IE]><script language="javascript" type="text/javascript" src="flot/excanvas.min.js"></script><![endif]-->
<script type="text/javascript" src="media/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="media/js/jquery.flot.js"></script>
<script type="text/javascript" src="media/js/jquery.flot.pie.js"></script>
</head>
<body>
<div id="pieChart" style="width: 400px; height: 300px">
</div>
</body>
<script type="text/javascript">
$(function () {
var optionPie = {
series: {
pie: {
show: true,
radius: 'auto', // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
innerRadius: 0,
startAngle: 3 / 2,
tilt: 0.8,
offset: {
top: 0,
left: 'auto'
},
stroke: {
color: '#FFF',
width: 1
},
label: {
show: true,
formatter: function (label, slice) {
return '<div style="font-size:x-small;text-align:center;padding:2px;color:' + slice.color + ';">' + label + '<br/>' + Math.round(slice.percent) + '%</div>';
}, // formatter function
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
background: {
color: null,
opacity: 0
},
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
},
combine: {
threshold: -1, // percentage at which to combine little slices into one larger slice
color: null, // color to give the new slice (auto-generated if null)
label: 'Other' // label to give the new slice
},
highlight: {
//color: '#FFF', // will add this functionality once parseColor is available
opacity: 0.5
}
}
}
};
var pieData = [
{ label: "Jan", data: [[1, 20]] },
{ label: "Feb", data: [[1, 20]] },
{ label: "March", data: [[1, 20]] }
];
$.plot($("#pieChart"), pieData, optionPie);
});
</script>
</html>
0 0
- JQuery flot pie chart plugin简单例子
- jquery flot pie画饼图
- Pie Chart 学习例子
- 利用 jquery flot pie 生成饼图
- 利用 jquery flot pie 生成饼图
- jQuery flot stacked bar chart example
- jquery.flot.js 简单使用
- Flot Pie Examples
- jQuery Flot 绘制简单折线图
- jQuery Flot 绘制简单折线图
- jquery flot
- jQuery easy pie chart 插件使用(基于HTML5)
- chart and pie
- flex3.0 chart pie
- dojo.Chart2D----Pie chart
- Pie Chart "Key"
- Silverlight Pie Chart
- ExtJS - Pie Chart
- cinder list查询服务出现error
- 第7章 进程环境
- iOS9适配之Bitcode错误
- 初识内核对象
- UVA10976 Fractions Again?!
- JQuery flot pie chart plugin简单例子
- IOS 获取苹果手机的分辨率
- 【排序算法】选择排序
- 字符编码
- iPhone开发之UIScrollView滚动组件的使用(三) 拖线实现按钮控制大图移动之contentInsets增加内容边距
- HDU 1171 Big Event in HDU
- Gym 100733E Shi's throne(水题)
- sql关系型和no-sql非关系型数据库区别
- Common Lisp 学习笔记(1)