Highcharts 饼图数值显示在图形上
2024-08-28 19:34:12
1.引用js文件
<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.2.min.js"></script>
<script src="/global/plugins/highcharts/highcharts.js" type="text/javascript"></script>
<script src="/global/plugins/highcharts/highcharts-3d.js" type="text/javascript"></script>
<!-- <script src="/global/plugins/highcharts/themes/grid.js" type="text/javascript"></script>-->
<script src="/global/plugins/highcharts/modules/exporting.js" type="text/javascript"></script>
2.主体部分
<div id="container" style="min-width:400px;height:400px"></div>
$(function () { $(document).ready(function () { // Build the chart
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: true
},
title: {
text: '数值显示在图形区域'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
distance: -30,
format:'<b>{point.y}</b>', },
showInLegend: true }
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
type: 'pie',
name: '占比',
distance: -10,
data: [
['Firefox', 45.0],
['IE', 26.8],
{
name: 'Chrome',
y: 12.8,
sliced: true,
selected: true
}
]
}]
});
}); });
最新文章
- VirtualBox虚拟机运行Ubuntu如何不卡
- 地图定位IOS8之后的定位
- OC-内存管理-基本原理与引用计数器
- Watir资源列表【转】
- PLSQL_性能优化系列18_Oracle Explain Plan解析计划通过Baseline绑定
- hive[3] 数据类型和文件格式
- 【Construct Binary Tree from Preorder and Inorder Traversal】cpp
- SqlServer中创建Oracle连接服务器
- CodeFile与CodeBehind的区别
- 使用selenium时提示:ImportError:No module named selenium
- Spring Boot 使用 Log4j2
- SQL 获取时间段内日期列表
- 精读《Scheduling in React》
- Numpy安装
- lrzsz 移植到 ARM-linux 嵌入式板子上
- 【delphi】delphi操作sqlite3
- Entity Framework应用:EntityFramework DataBase First模式
- 2018.4.23 linux系统
- Oracle中NVARCHAR2与VARCHAR2的相互转换
- i2c 异常之i2c1 prob 检测超时
热门文章
- MySQL的xml中对大于,小于,等于的处理转换
- 论一个X倒下了千千万万个X站起来了
- [NOIP2019模拟赛]LuoguP4261白金元首与克劳德斯
- [模拟退火][UVA10228] A Star not a Tree?
- 跟我一起使用socket.io创建聊天应用
- LUOGU P4163 [SCOI2007]排列
- nc 文件的nan识别
- Solrj demo
- python 读取excel Xlrd模块
- quartz任务调度基础: Job/Trigger/Schedule