`
wanggeying
  • 浏览: 62761 次
  • 性别: Icon_minigender_2
  • 来自: 济南
社区版块
存档分类
最新评论

浅谈echart

 
阅读更多

 

 

伪代码如下:

<body>

         <div id="pic" style="width:300px;height:150px;"></div>

</doby>

<script>

          var myCharts1 = echarts.init(document.getElementById('pic'));//制作容器

          var option1 = {

        tooltip : {

            trigger: 'item',

            formatter: "{a} <br/>{b} : {d}%"

      },

       series : [{

            name:'访问量',

                     type:'pie',

                     clockwise:'true',

                     startAngle:'0',

                     radius : '80%',//圆饼大小

                    data:[

                     {

                        value:80,

                        name:首页,

                        itemStyle:{

                            normal:{

                                color:'rgb(255,192,0)',

                                shadowColor:'rgba(0,0,0,0.8)'

                            }

                        }

                     },

                     {

                        value:20,

                        name:组织机构,

                        itemStyle:{

                            normal:{

                                color:'rgb(122,48,158)'

                            }

                        }

                    }

                ],

            }]

    };

   myCharts1.setOption(option1);//把内容填充到容器中

         }

</script>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics