highcharts java_highcharts 高级应用—动态饼图的实现

效果如下:

7f7bb909b00e0ae477e4fddc8a110c48.png

直接运行该JSP,你会看到效果,代码如下:

Highcharts Example

var chart;

$(document).ready(function() {

chart = new Highcharts.Chart({

chart: {

renderTo: 'container',

plotBackgroundColor: null,

plotBorderWidth: null,

plotShadow: false,

events: {

load: function() {

// set up the updating of the chart each second

var series = this.series[0];

setInterval(function() {

var data = [];

data.push(['Firefox', Math.random()]);

data.push(['IE', Math.random()]);

data.push(['Safari', Math.random()]);

data.push(['Opera', Math.random()]);

data.push(['Others', Math.random()]);

series.setData(data);

}, 2000);

}

}

},

title: {

text: 'Java小强制作'

},

tooltip: {

formatter: function() {

return ''+ this.point.name +': '+ this.percentage +' %';

}

},

plotOptions: {

pie: {

allowPointSelect: true,

cursor: 'pointer',

dataLabels: {

enabled: true,

color: '#000000',

connectorColor: '#000000',

formatter: function() {

return ''+ this.point.name +': '+ this.percentage +' %';

}

}

}

},

series: [{

type: 'pie',

name: 'Browser share',

data: [

['Firefox',   45.8],

['IE',       26.8],

['Safari',    8.5],

['Opera',     6.2],

['Others',   12.7]

]

}]

});

});

废话不再多说!

推荐您阅读更多有关于“ 饼图动态highcharts ”的文章

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值