Highcharts - Pie Chart
1. 饼状图(Pie Chart)示例:
<div id="container" style="height: 400px"></div>
<script type="http://.....jquery-1.9.1.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
type: 'pie',
plotBackgroundColor: 'lightgrey',
plotBorderWidth: 2,
plotShadow: true
},
title: {
text: 'Pie chart'
},
colors: ['#7cb5ec','#434348','#90ed7d', 'grey'],
credits: {
text: 'Designed by IT Dept.'
},
tooltip: {
pointFormat: '{point.name}:<b>{point.y}</b>',
headerFormat: ''
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true
},
showInLegend: true
}
},
series: [{
name: 'Sales',
data: [['A',29.9], ['B',71.5], ['C',106.4], ['D',129.2]]
}]
});
});
</script>
效果:

2. 对于饼状图(Pie Chart),由于数据格式的特殊性,在tooltip中可以使用{point.name}来获取数据的Key值,使用{point.y}来获取数据的Value值;
饼状图(Pie Chart)的数据格式:
series: [{
name: 'Sales',
data: [['A',29.9], ['B',71.5], ['C',106.4], ['D',129.2]]
}]
获取Json格式数据的Key和Value:
tooltip: {
pointFormat: '{point.name}:<b>{point.y}</b>',
headerFormat: ''
},
效果图:

2. 在饼状图的toolTip中,point.key在headerFormat中可以显示为Key值,但在pointFormat中显示为该key的序号(从0开始);
3.
Highcharts - Pie Chart的更多相关文章
- 微软BI 之SSRS 系列 - 解决Pie Chart 中控制标签外部显示与标签重叠的问题
当 Pie Chart 页面标签过多的时候,往往数字标签内容挤做一团.我们要做的是:第一,让标签在饼图外部显示:第二,不让标签重叠. 一种做法是通过修改数字标签属性 - Series Label Pr ...
- c# 通过.net自带的chart控件绘制饼图pie chart
c# 通过.net自带的chart控件绘制饼图pie chart 需要实现的目标是: 1.将数据绑定到pie的后台数据中,自动生成饼图. 2.生成的饼图有详细文字的说明. 具体的实现步骤: > ...
- Iocomp控件教程之Pie Chart——饼状图控件
Pie Chart--饼状图控件(Pie Chart)以饼状图形式显示每一个项目内容所占的百分比比重.在设计时.能够使用属性编辑器加入或者移除项目以及更改属性值.在执行时.使用AddItem,Remo ...
- Relative-Frequency|frequency|pie chart |bar chart
2.2Organizing Qualitative Data The number of times a particular distinct value occurs is called its ...
- bubble chart|Matrix Scatter|Overlay Scatter|Scatterplots|drop-line|box plot|Stem-and-leaf plot|Histogram|Bar chart|Pareto chart|Pie chart|doughnut chart|
应用统计学 对类别数据要分类处理: Bar chart复式条形图便于对比: Pareto chart:对类别变量依据频数高低排列: Pie chart:饼图用于一个样本,可以区分类别数据 doughn ...
- Highcharts Pie 饼图提示标签IE下重叠解决方法,及json数据绑定方法
一.提示标签重叠解决方法: series: [{ startAngle:90,//添加这个属性,就可以解决 type: 'pie', name: '充值方式' }] 不知道为什么,上述方法不行了.第一 ...
- highcharts 组合chart
/** *制作 复杂的组合型的 charts * *@param [options] 图表的默认配置 *@dependence jQuery.highcharts *@author wch */ fu ...
- Highcharts - Bar Chart & Column Chart
1. 条形图(Bar Chart)需要的数据格式类型如下: ["Luke Skywalker", "Darth Vader", "Yoda" ...
- Matplotlib学习---用matplotlib画饼图/面包圈图(pie chart, donut chart)
我在网上随便找了一组数据,用它来学习画图.大家可以直接把下面的数据复制到excel里,然后用pandas的read_excel命令读取.或者直接在脚本里创建该数据. 饼图: ax.pie(x,labe ...
随机推荐
- liunx 安装 phpstudy
phpStudy Linux版&Win版同步上线 支持Apache/Nginx/Tengine/Lighttpd/IIS7/8/6 phpStudy for Linux 支持Apache/Ng ...
- hdu1686 Oulipo kmp
题目传送门 思路:kmp模板,稍微修改下 #include<bits/stdc++.h> #define clr(a,b) memset(a,b,sizeof(a)) using name ...
- LightOJ - 1140 统计0的数位 数位DP
注意以下几点: 搜索维度非约束条件的都要记录,否则大概率出错,比如_0 st参数传递和_0的互相影响要分辨清楚 num==-1就要返回0而不是1 #include<iostream> #i ...
- js关于原型,原型链的面试题
之前面试的时候遇到过原型和原型链方面的题目,具体的已经忘了,只记得当时回答的稀里糊涂,今天查了一些资料,把自己所理解的写出来,加深记忆. 1,前提 在js中,对象都有__proto__属性,一般这个是 ...
- Ibatis批量处理
1.插入 <insert id="insTable" resultClass="int"> INSERT INTO [dbo].[table] ([ ...
- PIE SDK算法的自定义扩展
1.算法功能简介 算法的自定义扩展允许用户自主开发新的算法.自定义的算法必须实现PIE.SystemAlgo.BaseSystemAlgo基础类,这样才能被PIE的算法管理器调用起来. 2.算法功能实 ...
- 2.5 Go错误处理
defer import "fmt" func testDefer(){ defer fmt.Println() defer fmt.Println() fmt.Println() ...
- shell 进阶之匹配字符串
一,操作字符串 1,字符串长度 expr 命令取字符串函数 自带shell函数读取 2,匹配字符串开头字串的长度 !!!!!!!!!!!!$substring是正则表达式.!!!!!!!!! ...
- Thinkphp基于规则的Auth权限认证类
PS:onethink是基于该权限认证类实现,Auth类作为官方类库,在Library\Think里面. 其实Auth类也是基于角色访问控制RBAC扩展的,具体到节点的权限校验方式还是需要根据业务 ...
- opensuse install oracle 11gR2 Error in invoking target 'agent nmhs' of makefile '../ins_emagent.mk'
转自 http://blog.csdn.net/ly5156/article/details/6647563 遭遇Error in invoking target 'agent nmhs' of ma ...