解决HighCharts饼图中如果所占百分比为0的时候,不显示边线及0%的方法
2012-04-01 09:49
393 查看
<div class="piecleft" id="chart" style="height:350px; width: 350px;"> </div> <script type="text/javascript" charset="utf-8"> var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'chart' }, title: { text: '版本分布分析' }, plotArea: { shadow: null, borderWidth: null, backgroundColor: null }, tooltip: { formatter: function() { return '<b>'+ this.point.name +'</b>: '+ Highcharts.numberFormat(this.percentage, 1) +'% ('+ Highcharts.numberFormat(this.y, 0, ',') +' 个)'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, formatter: function() { if (this.percentage > 0) return '<b>' + this.point.name + '</b>: ' + this.percentage + ' %'; //这里进行判断(看这里) }, color: 'white', style: { font: '13px Trebuchet MS, Verdana, sans-serif' } } } }, legend: { backgroundColor: '#FFFFFF', x: 0, y: -30 }, credits: { enabled: false }, series: [{ type: 'pie', name: 'Browser share', data: [ ['1.1',3617], ['1.2.1',3436], ['1.0',416], ['1.3',2], ['1.2',1], ['新增对比',5000] ] }] }); }); </script>
对比前 对比后
相关文章推荐
- 解决HighCharts饼图中如果所占百分比为0的时候,不显示边线及0%的方法
- MySQL中文常见乱码问题解决方法其一,可以解决觉大多是乱码问题。如果你的中文显示为?的时候一般都有效。
- 在做CRM界面的时候遇到的DIV滚动条自动显示的问题!!和解决方法!
- 在使用Jquery的时候明明checked属性存在但是attr('checked')却显示undefine的原因以及解决方法
- 开机的时候如果出现提示$home/.dmrc无法写入 问题解决方法
- Stm32f1 Keil5调试时候peripherals不显示的解决方法
- 每次关机的时候总显示[742.602384]system halted,关不了机,只能强制关机,解决方法
- 在使用Gson的toJson()方法转为json字符串的时候无法显示中文和符号的问题(已解决)
- 每次关机的时候总显示[742.602384]system halted,关不了机,只能强制关机,解决方法
- smartform中,金额和数量字段显示的时候和其它字段不在同一水平面上的解决方法
- eclipse debug调试的时候不显示源码的解决方法
- 关于.Net 调试 运行的时候,页面无法显示的解决方法
- SyntaxHighlighter与ajax公用的时候不能正常显示代码高亮的解决方法
- C#/asp.net下如果显示保留小数位数及百分号的解决方法
- 关于Highcharts的x轴密密麻麻的时间格式显示问题解决方法
- android ViewPager在拖拽到左边和右边的时候,禁止显示黄色或者蓝色的渐变图片的解决方法
- 关于ComboBox显示下拉列表的时候显示不出来的解决方法
- Skype在线但是在ie和火狐上测试zencart时候无法都显示在线解决方法
- 关于svn学习笔记(如果项目中svn信息和图标不显示了,解决方法)
- 删除文件时候显示“文件已在资源管理器中打开”快速解决方法