码迷,mamicode.com
首页 > Web开发 > 详细

饼状图的js

时间:2015-11-20 19:15:07      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
  <script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
  <script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/exporting.js"></script>
 <script type="text/javascript">
                 $(function () {
    $(‘#container‘).highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: ‘总用户数{$cou}‘
        },
        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: ‘Browser share‘,
            data: [
                         <foreach name="b"  item="vo">
                                [‘{$vo.a}‘,   {$vo.b}],
                         </foreach>
            ]
        }]
    });
});              
          </script>

饼状图的js

标签:

原文地址:http://www.cnblogs.com/moshen/p/4981311.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!