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

饼图的说明

 
阅读更多
$(function () {
            var chart;
            //加载highcharts图表
            $(document).ready(function () {

                // Build the chart
                chart = new Highcharts.Chart({
                    chart: {
                        renderTo: 'container',//装载容器id
                        plotBackgroundColor: null,
                        plotBorderWidth: null,
                        plotShadow: false
                    },
                    title: {
                        text: 'highcharts饼图实现图例(Legend)的显示'
                    },
                    tooltip: {
                        pointFormat: '{series.name}: <b>{point.percentage}%</b>',
                        percentageDecimals: 1 //百分比保留小数
                    },
                    plotOptions: {
                        pie: {
                            allowPointSelect: true, //选中某块区域是否允许分离
                            cursor: 'pointer',
innerSize: '20' //也可以配置为10%的百分比形式,大于0,位环状的形式
                            dataLabels: {
                                enabled: true //是否直接呈现数据 也就是外围显示数据与否
                            },
                            showInLegend: true //是否显示图例
                        }
                    },
                    series: [{
                        type: 'pie',
                        name: 'Browser share',
                        data: [
                    ['Firefox', 45.0],
                    ['IE', 26.8],
                    {
                        name: 'Chrome',
                        y: 12.8,
                        sliced: true,
                        selected: true
                    },
                    ['Safari', 8.5],
                    ['Opera', 6.2],
                    ['Others', 0.7]
                ]
                    }]
                });
            });

});
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics