pie.vue 1.57 KB
<!-- 性别统计 -->
<template>
    <div>
        <!-- 顶部区域 S-->
        <div class="ipage_top">
            <div class="tit"><img :src="bindIcon()"/>{{title||chartData.title}}</div>
        </div>
        <div class="ichart">
            <pie-chart ref="chart" :cdata="chartData"></pie-chart>
        </div>
    </div>
</template>

<script>
import mixin from './mixin';
/**********************************************************/
const chartsConfig = {
    sexStatic2:{
        otherConf:{
            _double:true
        }  
    },
    default:{ //默认 //性别统计
        otherConf:{
            radius:['0%','60%'],
            _color:['#3F8CFF','#FFD48A'],
            legendObj:{
                show:true
            }
        }
    }
};
/*******************************************************/
export default {
    mixins: [mixin],
    data() {
        return {
            configObj:{}
        }
    },
    created() {
        
    },
    methods: {
        getChartsConfig(){
            return chartsConfig;
        },
        loadChartData(params){
            this.chartId = this.getChartId(this.ckey);
            if(this.chartId){
               this.ajaxModuleData().then(data=>{
                  this.setChartData(data);
               });
            }
        },
        setChartData(data){
            this.chartData = Object.assign({},data,{
                otherConf:this.configObj.otherConf||{}
            });
            this.chartData.series[1] = JSON.parse(JSON.stringify(this.chartData.series[0]));
        }
    }
}
</script>

<style  lang="less">

</style>