zoukankan      html  css  js  c++  java
  • echarts 饼图

    echarts 饼图

    <!DOCTYPE html>
    <html>
      <head>
      <base href="<%=basePath%>">
      <title>测试</title>
      
      <meta http-equiv="pragma" content="no-cache">
      <meta http-equiv="cache-control" content="no-cache">
      <meta http-equiv="expires" content="0">  
      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
      <meta http-equiv="description" content="This is my page">
      <link rel="stylesheet" href="css/bootstrap.min.css">
      
      
    </head>
    
    <body>
        <section class="hj-second-page-section">
          <div class="container-fluid">
            <div class="rows">
              <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="rows">
                  <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 hj-jumbotron-div">
                    <div class="panel panel-primary ng-scope">
                     
                     <!-- pannel start -->
                     <div class="panel-body vc-pannel-body-toggle">
                         <div class="rows ng-scope">
                           <div class="panel-body vc-msg-panel-body">
                             <div class="row">
                              
                              <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                 <div id="rt_chart1" style=""></div>
                              </div>
                              
                             </div>
                          </div>
                         </div>
                         
                     </div>
                    
                     <!-- pannel end -->
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </section>
          
        
        <script src="js/echarts2.js"></script>
        <script src="js/jquery-2.2.3.min.js"></script>
        
        <script>
          /**
           * @description 绘制柱状图
           * @author luohan
           * @date 2017-7-28
           * @param 
           */
          function initChart1() {
            $("#rt_chart1").height(660);
            $("#rt_chart1").width(1205);
            $("#rt_chart1").css("border","1px solid #ddd");
            var myChart1 = echarts.init(document.getElementById("rt_chart1"));
    
            var option1 = {
                    title : {
                        text: '',
                        subtext: '',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient : 'vertical',
                        x : 'left',
                        data:['指标1','指标2','指标3','指标4','指标5']
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: true},
                            dataView : {show: true, readOnly: false},
                            magicType : {
                                show: true, 
                                type: ['pie', 'funnel'],
                                option: {
                                    funnel: {
                                        x: '25%',
                                         '50%',
                                        funnelAlign: 'left',
                                        max: 1548
                                    }
                                }
                            },
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    series : [
                        {
                            name:'',
                            type:'pie',
                            radius : '55%',
                            center: ['50%', '60%'],
                            
                            data:[
                                {value:3,name:'指标1'},
                                {value:17,name:'指标2'},
                                {value:2,name:'指标3'},
                                {value:4,name:'指标4'},
                                {value:33,name:'指标5'}
                                
                            ]
                        }
                    ]
                };
                        
    
    
            // 为echarts对象加载数据
            myChart1.setOption(option1);
          }
    
          initChart1();
        </script>
    </body>
    </html>

  • 相关阅读:
    总结的CSS简写表
    ASP.net 2.0:我还有多少秘密你不知道?(1)
    判断自然数的阶乘大于等于400,然后计算此数的平方,再一次减1计算其平方和,直到数字减小到0(演示Exit DO)
    JSP留言板程序开发过程
    double>string的时候,如何保留两位小数?
    asp如何清除html代码
    利用ASP.NET来访问Excel文档
    C#日期函数所有样式大全
    ASP.net在线购物商城系统完全解析
    创立公司的准备
  • 原文地址:https://www.cnblogs.com/herd/p/14006107.html
Copyright © 2011-2022 走看看