`
zengshaotao
  • 浏览: 752841 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

pie图配置说明

 
阅读更多

$(function () {

    $('#container').highcharts({

        chart: {

            plotBackgroundColor: ‘’,

            plotBorderWidth: ‘’,

            plotShadow: false

        },

        title: {

            text: 'Browser market shares'

        },

        tooltip: {

            //饼图特有的属性配置

       pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'

        },

        plotOptions: {

            pie: {

                allowPointSelect: true,//为true时,鼠标点击相应部分时,会有动画移出

                cursor: 'pointer',//鼠标移到饼图上时提示的图形

                dataLabels: {//饼图各个部分的提示配置

                    enabled: true,//饼图周围有相应组成成分的数据提示

                    color: '#000000',//提示的字体颜色

                    connectorColor: '#000000',//连接线的颜色(数据和图形的连接线)

                    //这里的point表示的是series.data里的一个对象,类似于['Firefox',   45.0]

                    //point.percentage:.2f 表示占用的百分比,显示格式是2位的浮点小数

                    format: '<b>{point.name}</b>: {point.percentage:.2f} %'

                }

            }

        },

        series: [{

            type: 'pie',

            name: 'Browser share',

            data: [

                ['Firefox',   35.0],

                ['IE',      36.8],

                {

                    name: 'Chrome',

                    y: 11.8,

                    sliced: true,

                    selected: true

                },

                ['Safari',    7.5],

                ['Opera',     7.2],

                ['Others',   1.7]

            ]

        }]

    });

});

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics