var tmpl=`
<div id="pie" style="width:90%;height:372px">
</div>
`
module.exports=
`{
   template:'${tmpl}',
   props:["piestyle","data"],
   data:function(){
     return {
       option:this.data,
       mainChart:null,
     };
   },
   methods:{
     getEchartObj(){
       if(!this.mainChart){
            return null;
       }
       return this.mainChart;
     },
     setSteps(msteps){
        this.steps=msteps;
     },
     buildEcharts(id){
         this.mainChart = echarts.init(document.getElementById(id));
         var options = this.option;
         this.mainChart.setOption(options);

     },
   },
   created:function(){

   },
   mounted:function(){
    var id=Math.round(Math.random()*500);
     $('#pie').attr('id','pie_'+id);
     this.buildEcharts("pie_"+id);
   },
   vname:"gsb-echart1"
}`
