当使用highcharts做数据展现时,利用饼状图模型可以非常方便直观的分析出数据,但是有的时候我们不需要显示具体百分比,而需要自定义数据或是直接调用传值数据
$('#container').highcharts({ chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'IP流量TOP10' }, tooltip: { pointFormat: '{series.name}: ' }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorColor: '#000000', formatter: function() { } } } }, series: [{ type: 'pie', name: 'Browser share', data: {{flow|safe}} }] }); });
将原有
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
修改成
return '<b>'+ this.point.name +'</b>: '+ Highcharts.numberFormat(this.y, 0, ',');
Tags:
Del.icio.us Facebook TweetThis Digg StumbleUpon
Comments:1 (One) on this item
You might be interested in this: python调用shell命令三种方法区别【转】 python webshell扫描器 让企业网络监控更直观有效-【smokeping深入研究】 Python根据dell api查询服务器保修期小程序 第二版 游戏服务器系统及服务器安全的一些小结
Copyright ??颓废的腰子技术Blog [highcharts饼图将显示百分比改成具体传值数字], All Right Reserved. 2015. 呼唤你前往另一个地方,过上另一种生活。
Copyright ??颓废的腰子技术Blog [highcharts饼图将显示百分比改成具体传值数字], All Right Reserved. 2015. 呼唤你前往另一个地方,过上另一种生活。