abar.vue 1.53 KB
<!-- 年龄统计 -->
<template>
    <div>
        <!-- 顶部区域 S-->
        <div class="ipage_top">
            <div class="tit"><img :src="bindIcon()"/>{{title||chartData.title}}</div>
            <div class="acts">
                <slot name="action"></slot>
            </div>
        </div>
        <div class="ichart">
            <stack-chart ref="chart" :cdata="chartData"></stack-chart>
        </div>
    </div>
</template>

<script>
import mixin from './mixin';
/**********************************************************/
const chartsConfig = {
    default:{ //默认 //年龄统计
        otherConf:{
            _color:['#3F8CFF','#FFD48A'],
            doubleYaxis: true,
            isSwapY: true
           // hasYaxisName:false,
        }
    }
};
/*******************************************************/
export default {
    mixins: [mixin],
    data() {
        return {
            configObj:{},
            
        }
    },
    watch: {
        
    },
    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||{}
            });
        }
    }
}
</script>

<style  lang="less">

</style>