Highcharts 统计报表的使用(饼状图)

<!--第一步,引入js-->

<script src="../../Scripts/jquery-1.7.1.js"></script>
<script src="../../Scripts/highcharts.js"></script>

<!--第二步,创建一个div,用于显示-->

  <div class="div-img mt-10" id="container" style="width: 940px; height: 250px;">

<!--编写脚本-->

<script>
    $(function () {
        $('#container').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: '知识点分布饼状图'

            },
            subtitle: {
                text: '饼状图',
                x: -20
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                    }
                }
            },
            series: [{
                type: 'pie',
                name: '比例',
                data: [
                     {
                         name: '男',
                         y: 4
                     },
                     {
                         name: '女',
                         y: 4
                     },
                     {
                         name: '变态',
                         y: 2
                         //sliced: true,
                         //selected: true
                     }
                ]
            }]
        });
    });

</script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值