请教highcharts饼状图在IE下,数据为零时,显示的图形不齐全

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了请教highcharts饼状图在IE下,数据为零时,显示的图形不齐全相关的知识,希望对你有一定的参考价值。

参考技术A 既然你的数据是从数据库动态读取的,那你就把日、月、年当成参数传入你的sql语句,并按照这个参数进行分组显示数据,例如: 读取完数据后,接着就是往前台绑定json数据了,绑定json数据可参考如下图: 至此,你想实现的功能就可以实现了

highcharts实现饼状图

<!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饼状图在IE下,数据为零时,显示的图形不齐全的主要内容,如果未能解决你的问题,请参考以下文章

java代码实现highchart与数据库数据结合完整案例分析---饼状图

highcharts为饼状图添加点击事件能获得啥值

Highcharts饼图数据为0时 ie浏览器下图例不显示 chrome下图例会显示一根棍为啥?

怎么制作三维饼状图

highcharts实现饼状图

highcharts+jsp+springDataJpa实现饼状图,树状图