highChart另类使用及一些属性

效果图:



具体代码:

包括背景透明,图表中载入图片等;

function showPie(name){
	var a =  [
                		{name:'A',y:100,href:'http://www.baidu.com',color:'#D587CE'},
                    {name:'B',y:30,href:'http://www.baidu.com',color:'#34E3FF'},
                    {name:'C',y:10,href:'http://www.baidu.com',color:'#8EF58B'},
                    {name:'D',y:10,href:'http://www.baidu.com',color:'#F1FE19'},
                    {name:'E',y:5,href:'http://www.baidu.com',color:'#F8E104'},
                    {name:'F',y:5,href:'http://www.baidu.com',color:'#F68101'}
          ]
          
	var  chartOption = {
            chart: {
                renderTo: name,
                backgroundColor: 'rgba(255, 255, 255, 0)',
                plotBorderColor : null,
                plotBackgroundColor: null,
                plotBackgroundImage:null,
                plotBorderWidth: null,
                plotShadow: false,  
                borderWidth : 0,
                events: {
                load: function() {
                    this.renderer.image('cg.png', 41, 38, 40, 43) //位置参数 left top right bottom
                        .attr({
                            zIndex: 7
                        })
                        .add();
                }
            }
            },
						credits :{
								enabled:false
						},
            title: {
                text: ''
            },

            tooltip: {
                formatter: function() {
                    //alert(1);
                    //return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                     return '<b>'+ this.point.name +'</b>: '+ this.y;
                },
                style: {
                    color: '#333333',
                    fontSize: '10pt',
                    padding: 5,
                    zIndex:9999
                }
            },

            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    borderWidth : 0,
                    cursor: 'pointer',
	                  dataLabels: {
	                  enabled: false
	                },
	              showInLegend: false,
	              point: {  
	                    events : {  
	                         click: function(event){
	                           alert(this.y);      
	                             window.open(this.href);                            
	                         }
	                    }
	                  },
               dataLabels: {
                  enabled: false,
                  color: '#000000',
                  //distance: -20,
                  connectorColor: '#000000',
                  formatter: function() {
                      return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                  }

              },
               showInLegend: false,
               size:68
	              }
            },
            
            series: [{
                type: 'pie',
                name: 'Browser share',
                data: a
                }]
         }	
         
          new Highcharts.Chart(chartOption); 
}


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值